{"id":47906644,"url":"https://github.com/c-ehrlich/trace-amp","last_synced_at":"2026-04-04T04:53:59.690Z","repository":{"id":336611174,"uuid":"1150383698","full_name":"c-ehrlich/trace-amp","owner":"c-ehrlich","description":"OTel Tracing wrapper for Amp","archived":false,"fork":false,"pushed_at":"2026-02-05T10:01:49.000Z","size":97,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T04:53:53.887Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/trace-amp","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/c-ehrlich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-05T08:03:19.000Z","updated_at":"2026-02-12T15:53:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/c-ehrlich/trace-amp","commit_stats":null,"previous_names":["c-ehrlich/trace-amp"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/c-ehrlich/trace-amp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-ehrlich%2Ftrace-amp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-ehrlich%2Ftrace-amp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-ehrlich%2Ftrace-amp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-ehrlich%2Ftrace-amp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c-ehrlich","download_url":"https://codeload.github.com/c-ehrlich/trace-amp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-ehrlich%2Ftrace-amp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31388169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-04T04:53:57.207Z","updated_at":"2026-04-04T04:53:59.685Z","avatar_url":"https://github.com/c-ehrlich.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trace-amp\n\nOpenTelemetry instrumentation for [Amp](https://ampcode.com) CLI.\n\n![Amp trace in Axiom](https://github-production-user-asset-6210df.s3.amazonaws.com/8353666/545447024-800a9a84-7251-462b-b1bd-9b6ab9dcd24c.png?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20260205%2Fus-east-1%2Fs3%2Faws4_request\u0026X-Amz-Date=20260205T081953Z\u0026X-Amz-Expires=300\u0026X-Amz-Signature=1e910a5938446c4f51e7f9e72c0a84241992a9d4c502a28ac733693452735209\u0026X-Amz-SignedHeaders=host)\n\nFully vibe coded, use at your own risk.\n\n## Installation\n\n```bash\nnpm install -g trace-amp\n```\n\n## Usage\n\nSet the required environment variables:\n\n```bash\nexport OTEL_EXPORTER_OTLP_ENDPOINT=\"https://api.axiom.co/v1/traces\"\nexport OTEL_EXPORTER_OTLP_HEADERS=\"Authorization=Bearer your-api-token,X-Axiom-Dataset=your-dataset\"\n```\n\nThen run:\n\n```bash\ntrace-amp \"ask the oracle to add 2+2\"\n```\n\nOr use `npx` without installing globally:\n\n```bash\nnpx trace-amp \"ask the oracle to add 2+2\"\n```\n\n## TypeScript Usage\n\n### Standalone (new OTel setup)\n\n```typescript\nimport { initTracing, shutdownTracing, createAmpClient } from 'instrument-amp';\n\ninitTracing({\n  serviceName: 'my-amp-agent',\n  otlpEndpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,\n});\n\nconst amp = createAmpClient();\nconst result = await amp.invoke('What files are in this directory?');\n\nconsole.log(result.finalResult);\n\nawait shutdownTracing();\n```\n\n### With existing OTel setup\n\nIf you already have OpenTelemetry configured, skip `initTracing()` - spans will automatically use your existing provider. Pass `parentContext` to nest Amp spans under an existing trace:\n\n```typescript\nimport { trace, context } from '@opentelemetry/api';\nimport { createAmpClient } from 'instrument-amp';\n\nconst amp = createAmpClient();\n\n// Option 1: Amp spans nest under the current active span automatically\nawait amp.invoke('prompt');\n\n// Option 2: Explicit parent context (e.g., from incoming request)\nconst parentContext = trace.setSpanContext(context.active(), {\n  traceId: requestTraceId,\n  spanId: requestSpanId,\n  traceFlags: 1,\n});\nawait amp.invoke('prompt', { parentContext });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-ehrlich%2Ftrace-amp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc-ehrlich%2Ftrace-amp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-ehrlich%2Ftrace-amp/lists"}