npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kidkender/archmind-runtime-ingest

v0.1.0

Published

Ingests OpenTelemetry (OTLP JSON) runtime spans and normalizes them for correlation with ArchMind execution graphs.

Readme

@archmind/runtime-ingest

Turns raw OpenTelemetry JSON exports into clean, structured trace sessions — the first step in ArchMind's runtime intelligence pipeline.


The gap it fills

Static code analysis tells you what an endpoint can do. It cannot tell you what it actually did during a real request — how many database queries fired, which service calls ran, how long each one took.

OpenTelemetry captures exactly that. But raw OTLP JSON is verbose, deeply nested, and uses typed attribute containers that are awkward to work with. @archmind/runtime-ingest handles the parsing and normalization so the rest of the system works with clean, flat OtelSpan objects.

It is deliberately framework-agnostic. The same ingestor works regardless of whether the spans came from Laravel, Express, Django, or a custom OTel exporter.


What it produces

A TraceSession — the complete normalized picture of a single HTTP request:

{
  sessionId:   the traceId of the root span
  entrypoint:  e.g. "PUT /tasks/{id}"  (from http.route attribute)
  durationMs:  total request duration
  spans:       OtelSpan[]  (normalized, flat attributes)
  recordedAt:  ISO timestamp
}

Attributes are flattened from OTLP's typed format ({ key, value: { stringValue } }) into plain Record<string, string | number | boolean> — so span.attributes["db.statement"] just works.


Key features

Span partitioning partitionSpans() splits spans into two groups: candidates (application-level spans that can be correlated to graph nodes) and infra (database queries, outbound HTTP calls, cache operations). This separation is critical for the runtime detectors — N+1 detection works on infra spans grouped under their candidate parent.

Entrypoint extraction Automatically finds the root HTTP span and extracts the http.route attribute, normalizing it to the "METHOD /path/{param}" format that matches the static graph's entrypoint strings.

Zero configuration No schema registration, no OTel collector, no server. Point it at a JSON file and get back a TraceSession.


Usage

import { ingestOtlpFile, partitionSpans } from "@archmind/runtime-ingest"

// Parse a recorded trace file
const session = ingestOtlpFile("/path/to/trace.json")

session.entrypoint    // "GET /tasks"
session.durationMs    // 800
session.spans.length  // 24

// Split into application spans vs. DB/cache/HTTP spans
const { candidates, infra } = partitionSpans(session.spans)

To record traces from a Laravel application, add the OpenTelemetry PHP SDK with a file exporter. The OTLP JSON format is the standard export format — any OTel-compatible exporter will produce files this ingestor can handle.


Running tests

cd packages/runtime-ingest
node --experimental-vm-modules ../../node_modules/jest/bin/jest.js