{"_id":"@cognitive-swarm/otel","name":"@cognitive-swarm/otel","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@cognitive-swarm/otel","version":"0.2.0","description":"OpenTelemetry distributed tracing for cognitive-swarm","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","test":"vitest run","test:watch":"vitest","lint":"eslint src/","clean":"rm -rf dist"},"dependencies":{"@cognitive-swarm/core":"*"},"peerDependencies":{"@opentelemetry/api":"^1.7.0"},"devDependencies":{"@opentelemetry/api":"^1.9.0","@opentelemetry/sdk-trace-base":"^1.30.0"},"license":"Apache-2.0","author":{"name":"Dmitry Zorin"},"repository":{"type":"git","url":"git+https://github.com/medonomator/cognitive-swarm.git","directory":"packages/otel"},"publishConfig":{"access":"public"},"homepage":"https://medonomator.github.io/cognitive-swarm/","bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"gitHead":"8613f7b139c03719ef14fe9f2c01bdc1c5532a26","_id":"@cognitive-swarm/otel@0.2.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-5yGuj/w9PbqAn7iy1NCnQ/SVuIb5jiz9dbvExyNEOexEulD465CDPHzfYpA1hZOJCUw3QH4hqytWrVyMV/z7yQ==","shasum":"c6ae1950edefa68c487ec3b7310b0d557248d931","tarball":"https://registry.npmjs.org/@cognitive-swarm/otel/-/otel-0.2.0.tgz","fileCount":22,"unpackedSize":46921,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFDeVxSGYQXL2sph+DqH3mE+UX7ZtsDTOvnkBu2BjBjRAiBlv5p+AEZ/lNtTFIEBudUctajPvGMjKAyIXQ+KBqbNLA=="}]},"_npmUser":{"name":"medonomator","email":"budteschastlivi1@gmail.com"},"directories":{},"maintainers":[{"name":"medonomator","email":"budteschastlivi1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/otel_0.2.0_1776497156405_0.1128474839521445"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T07:25:56.274Z","0.2.0":"2026-04-18T07:25:56.557Z","modified":"2026-04-18T07:25:56.850Z"},"maintainers":[{"name":"medonomator","email":"budteschastlivi1@gmail.com"}],"description":"OpenTelemetry distributed tracing for cognitive-swarm","homepage":"https://medonomator.github.io/cognitive-swarm/","repository":{"type":"git","url":"git+https://github.com/medonomator/cognitive-swarm.git","directory":"packages/otel"},"author":{"name":"Dmitry Zorin"},"bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"license":"Apache-2.0","readme":"# @cognitive-swarm/otel\n\nOpenTelemetry distributed tracing for cognitive-swarm.\n\n## Installation\n\n```bash\nnpm install @cognitive-swarm/otel\n```\n\n## Overview\n\nWraps a cognitive-swarm orchestrator with OpenTelemetry instrumentation. Every swarm run, agent turn, and signal exchange is captured as spans with semantic attributes. Works with any OTel-compatible backend (Jaeger, Grafana Tempo, Honeycomb, etc.).\n\n## Usage\n\n```ts\nimport { instrumentSwarm } from '@cognitive-swarm/otel';\n\n// Wrap an existing orchestrator\nconst instrumented = instrumentSwarm(orchestrator, {\n  serviceName: 'my-swarm',\n});\n\n// Run as usual -- spans are emitted automatically\nconst result = await instrumented.run({ task: 'Analyze this PR' });\n```\n\n### Advanced\n\n```ts\nimport { SpanManager, getTracer, ATTR } from '@cognitive-swarm/otel';\n\n// Access the tracer directly\nconst tracer = getTracer('my-component');\n\n// Use SpanManager for manual span lifecycle\nconst spanManager = new SpanManager(tracer);\nspanManager.start('custom-operation', { [ATTR.AGENT_ID]: 'analyst' });\n// ... do work ...\nspanManager.end();\n```\n\n## Exports\n\n| Export                      | Kind     | Description                              |\n| --------------------------- | -------- | ---------------------------------------- |\n| `instrumentSwarm`           | Function | Instrument an orchestrator               |\n| `SpanManager`               | Class    | Manual span lifecycle management         |\n| `getTracer`                 | Function | Get an OTel tracer instance              |\n| `ATTR`                      | Object   | Semantic attribute constants             |\n| `InstrumentableOrchestrator`| Type     | Orchestrator shape accepted by wrapper   |\n| `InstrumentedOrchestrator`  | Type     | Wrapped orchestrator with tracing        |\n| `InstrumentSwarmOptions`    | Type     | Options for `instrumentSwarm`            |\n\n## Links\n\n- [Root repository](https://github.com/medonomator/cognitive-swarm)\n","readmeFilename":"README.md","_rev":"1-56cac8efad952a116bfb31f029bcba82"}