{"id":18821406,"url":"https://github.com/borderless/worker-aws-xray","last_synced_at":"2025-07-07T19:33:57.196Z","repository":{"id":46469952,"uuid":"317740323","full_name":"borderless/worker-aws-xray","owner":"borderless","description":"AWS X-Ray client for Cloudflare Workers using `fetch`","archived":false,"fork":false,"pushed_at":"2023-12-12T06:40:26.000Z","size":832,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-30T03:42:10.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borderless.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-02T03:37:55.000Z","updated_at":"2024-05-29T17:59:28.000Z","dependencies_parsed_at":"2022-09-13T04:40:32.902Z","dependency_job_id":null,"html_url":"https://github.com/borderless/worker-aws-xray","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borderless%2Fworker-aws-xray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borderless%2Fworker-aws-xray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borderless%2Fworker-aws-xray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borderless%2Fworker-aws-xray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borderless","download_url":"https://codeload.github.com/borderless/worker-aws-xray/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239758900,"owners_count":19692041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-08T00:40:52.236Z","updated_at":"2025-02-20T01:14:10.774Z","avatar_url":"https://github.com/borderless.png","language":"TypeScript","readme":"# Worker AWS X-Ray\n\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][downloads-image]][downloads-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n\n\u003e [AWS X-Ray](https://aws.amazon.com/xray/) client for Cloudflare Workers using `fetch`.\n\n## Installation\n\n```\nnpm install @borderless/worker-aws-xray --save\n```\n\n## Usage\n\n```ts\nimport { AwsXray, Segment, captureFetch } from \"@borderless/worker-aws-xray\";\n\n// Capture `fetch` with tracing support.\nconst fetch = captureFetch(globalThis.fetch);\n\n// Create an AWS X-Ray client wrapper (for sending segments later).\nconst client = new AwsXray({\n  region: \"us-west-2\",\n  accessKeyId: \"abc\",\n  secretAccessKey: \"123\",\n});\n\naddEventListener(\"fetch\", async (event) =\u003e {\n  const segment = new Segment(\"worker\");\n\n  // Create a subsegment attached to `segment`.\n  const subsegment = segment.startSegment();\n\n  // Trace `fetch` requests with our captured client.\n  const res = await fetch(\"http://example.com\", { segment: subsegment });\n\n  // Segments must be ended before tracing.\n  subsegment.end();\n  segment.end();\n\n  // Forward traced segments to AWS.\n  event.waitUntil(client.traceSegment(segment));\n\n  // Finally respond to Cloudflare request.\n  event.respondWith(res);\n});\n```\n\n## License\n\nMIT\n\n[npm-image]: https://img.shields.io/npm/v/@borderless/worker-aws-xray.svg?style=flat\n[npm-url]: https://npmjs.org/package/@borderless/worker-aws-xray\n[downloads-image]: https://img.shields.io/npm/dm/@borderless/worker-aws-xray.svg?style=flat\n[downloads-url]: https://npmjs.com/package/@borderless/worker-aws-xray\n[travis-image]: https://img.shields.io/travis/com/borderless/worker-aws-xray.svg?style=flat\n[travis-url]: https://travis-ci.com/borderless/worker-aws-xray\n[coveralls-image]: https://img.shields.io/coveralls/borderless/worker-aws-xray.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/borderless/worker-aws-xray?branch=master\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborderless%2Fworker-aws-xray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborderless%2Fworker-aws-xray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborderless%2Fworker-aws-xray/lists"}