{"id":13527289,"url":"https://github.com/jaegertracing/jaeger-client-node","last_synced_at":"2025-10-05T06:31:20.429Z","repository":{"id":37549472,"uuid":"56551035","full_name":"jaegertracing/jaeger-client-node","owner":"jaegertracing","description":"🛑 This library is DEPRECATED!","archived":true,"fork":false,"pushed_at":"2022-09-13T01:06:58.000Z","size":1703,"stargazers_count":550,"open_issues_count":0,"forks_count":129,"subscribers_count":404,"default_branch":"master","last_synced_at":"2025-10-01T08:45:28.114Z","etag":null,"topics":["distributed-tracing","javascript-opentracing-api","node-js","opentracing"],"latest_commit_sha":null,"homepage":"https://jaegertracing.io/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaegertracing.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-19T00:11:04.000Z","updated_at":"2025-06-25T16:06:55.000Z","dependencies_parsed_at":"2022-08-26T15:30:55.322Z","dependency_job_id":null,"html_url":"https://github.com/jaegertracing/jaeger-client-node","commit_stats":null,"previous_names":["uber/jaeger-client-node"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/jaegertracing/jaeger-client-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaegertracing%2Fjaeger-client-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaegertracing%2Fjaeger-client-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaegertracing%2Fjaeger-client-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaegertracing%2Fjaeger-client-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaegertracing","download_url":"https://codeload.github.com/jaegertracing/jaeger-client-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaegertracing%2Fjaeger-client-node/sbom","scorecard":{"id":501894,"data":{"date":"2025-08-11","repo":{"name":"github.com/jaegertracing/jaeger-client-node","commit":"29365a4475285423490813187ea48136b5135167"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci-crossdock.yml:1","Warn: no topLevel permission defined: .github/workflows/ci-unit-tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":4,"reason":"Found 6/15 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-crossdock.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/jaegertracing/jaeger-client-node/ci-crossdock.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci-crossdock.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/jaegertracing/jaeger-client-node/ci-crossdock.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-crossdock.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/jaegertracing/jaeger-client-node/ci-crossdock.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-unit-tests.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/jaegertracing/jaeger-client-node/ci-unit-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-unit-tests.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/jaegertracing/jaeger-client-node/ci-unit-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci-unit-tests.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/jaegertracing/jaeger-client-node/ci-unit-tests.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci-unit-tests.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/jaegertracing/jaeger-client-node/ci-unit-tests.yml/master?enable=pin","Warn: containerImage not pinned by hash: crossdock/Dockerfile:1: pin your Docker image by updating node:14-alpine to node:14-alpine@sha256:434215b487a329c9e867202ff89e704d3a75e554822e07f3e0c0f9e606121b33","Warn: npmCommand not pinned by hash: crossdock/Dockerfile:15","Warn: npmCommand not pinned by hash: .github/workflows/ci-unit-tests.yml:52","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"46 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T22:08:08.983Z","repository_id":37549472,"created_at":"2025-08-19T22:08:08.984Z","updated_at":"2025-08-19T22:08:08.984Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278359203,"owners_count":25974092,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["distributed-tracing","javascript-opentracing-api","node-js","opentracing"],"created_at":"2024-08-01T06:01:45.053Z","updated_at":"2025-10-05T06:31:19.879Z","avatar_url":"https://github.com/jaegertracing.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![NPM Published Version][npm-img]][npm] [![OpenTracing 1.0 Enabled][ot-img]][ot-url]\n\n# 🛑 This library is DEPRECATED!\n\nThere will be no new releases of this library.\n\nWe urge all users to migrate to [OpenTelemetry](https://opentelemetry.io/). Please refer to the [notice in the documentation](https://www.jaegertracing.io/docs/latest/client-libraries/#deprecating-jaeger-clients) for details.\n\n# Jaeger Bindings for OpenTracing API for Node.js\n\nThis is [Jaeger](https://jaegertracing.io/)'s client side instrumentation library for Node.js that implements [Javascript OpenTracing API 1.0](https://github.com/opentracing/opentracing-javascript/).\n\nNote that this library is not designed to run in the browser, only in the Node.js-backend servers. For browser-only version, see https://github.com/jaegertracing/jaeger-client-javascript.\n\nSee the [OpenTracing tutorial](https://github.com/yurishkuro/opentracing-tutorial/tree/master/nodejs) for the introduction on using the OpenTracing API and the Jaeger SDK.\n\n## Contributing and Developing\n\nPlease see [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Installation\n\n`npm install --save jaeger-client`\n\n## Initialization\n\nThe Tracer defaults to sending spans over UDP to the jaeger-agent running on localhost; the jaeger-agent handles forwarding the spans to the jaeger-collector. When you are instantiating your client instance you can specify the sampler of your choice. The library support the following samplers:\n\n| SAMPLER       | KEY             |\n| ------------- | --------------- |\n| Constant      | `const`         |\n| Probabilistic | `probabilistic` |\n| Rate Limiting | `ratelimiting`  |\n| Remote        | `remote`        |\n\nMore information about sampling can be found [here](https://www.jaegertracing.io/docs/1.7/sampling/#client-sampling-configuration)\n\n```javascript\nvar initTracer = require('jaeger-client').initTracer;\n\n// See schema https://github.com/jaegertracing/jaeger-client-node/blob/master/src/configuration.js#L37\nvar config = {\n  serviceName: 'my-awesome-service',\n};\nvar options = {\n  tags: {\n    'my-awesome-service.version': '1.1.2',\n  },\n  metrics: metrics,\n  logger: logger,\n};\nvar tracer = initTracer(config, options);\n```\n\n### Environment variables\n\nThe tracer can be initialized with values coming from environment variables:\n\n```jhavascript:\nvar tracer = initTracerFromEnv(config, options);\n```\n\nNone of the env vars are required and all of them can be overridden via properties on the `config` object.\n\n| Property                         | Description                                                                                                                                                                                                                                                                                                      |\n| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| JAEGER_SERVICE_NAME              | The service name                                                                                                                                                                                                                                                                                                 |\n| JAEGER_AGENT_HOST                | The hostname for communicating with agent via UDP                                                                                                                                                                                                                                                                |\n| JAEGER_AGENT_PORT                | The port for communicating with agent via UDP                                                                                                                                                                                                                                                                    |\n| JAEGER_AGENT_SOCKET_TYPE         | The family of socket. Must be either 'udp4' or 'udp6' ('udp4' by default).                                                                                                                                                                                                                                       |\n| JAEGER_ENDPOINT                  | The HTTP endpoint for sending spans directly to a collector, i.e. http://jaeger-collector:14268/api/traces                                                                                                                                                                                                       |\n| JAEGER_USER                      | Username to send as part of \"Basic\" authentication to the collector endpoint                                                                                                                                                                                                                                     |\n| JAEGER_PASSWORD                  | Password to send as part of \"Basic\" authentication to the collector endpoint                                                                                                                                                                                                                                     |\n| JAEGER_REPORTER_LOG_SPANS        | Whether the reporter should also log the spans                                                                                                                                                                                                                                                                   |\n| JAEGER_REPORTER_FLUSH_INTERVAL   | The reporter's flush interval (ms)                                                                                                                                                                                                                                                                               |\n| JAEGER_REPORTER_TIMEOUT          | The reporter's http timeout (ms)                                                                                                                                                                                                                                                                                 |\n| JAEGER_SAMPLER_TYPE              | The sampler type                                                                                                                                                                                                                                                                                                 |\n| JAEGER_SAMPLER_PARAM             | The sampler parameter (number)                                                                                                                                                                                                                                                                                   |\n| JAEGER_SAMPLER_MANAGER_HOST_PORT | The HTTP endpoint when using the remote sampler, i.e. http://jaeger-agent:5778/sampling                                                                                                                                                                                                                          |\n| JAEGER_SAMPLER_REFRESH_INTERVAL  | How often the remotely controlled sampler will poll jaeger-agent for the appropriate sampling strategy                                                                                                                                                                                                           |\n| JAEGER_TAGS                      | A comma separated list of `name = value` tracer level tags, which get added to all reported spans. The value can also refer to an environment variable using the format `${envVarName:default}`, where the `:default` is optional, and identifies a value to be used if the environment variable cannot be found |\n| JAEGER_DISABLED                  | Whether the tracer is disabled or not. If true, the default `opentracing.NoopTracer` is used.                                                                                                                                                                                                                    |\n\nBy default, the client sends traces via UDP to the agent at `localhost:6832`. Use `JAEGER_AGENT_HOST` and `JAEGER_AGENT_PORT` to send UDP traces to a different `host:port`. If `JAEGER_ENDPOINT` is set, the client sends traces to the endpoint via `HTTP`, making the `JAEGER_AGENT_HOST` and `JAEGER_AGENT_PORT` unused. If `JAEGER_ENDPOINT` is secured, HTTP basic authentication can be performed by setting the `JAEGER_USER` and `JAEGER_PASSWORD` environment variables.\n\n#### Reporting spans via HTTP\n\nUDP has a hard size limit of 65,507 bytes; if the span is larger than this limit, the tracer will drop the span. To circumvent this, you can configure the tracer to directly send spans to the jaeger-collector over HTTP (skipping the jaeger-agent altogether).\n\n```javascript\nvar initTracer = require('jaeger-client').initTracer;\n\n// See schema https://github.com/jaegertracing/jaeger-client-node/blob/master/src/configuration.js#L37\nvar config = {\n  serviceName: 'my-awesome-service',\n  reporter: {\n    // Provide the traces endpoint; this forces the client to connect directly to the Collector and send\n    // spans over HTTP\n    collectorEndpoint: 'http://jaeger-collector:14268/api/traces',\n    // Provide username and password if authentication is enabled in the Collector\n    // username: '',\n    // password: '',\n  },\n};\nvar options = {\n  tags: {\n    'my-awesome-service.version': '1.1.2',\n  },\n  metrics: metrics,\n  logger: logger,\n};\nvar tracer = initTracer(config, options);\n```\n\n### Metrics and Logging\n\nThe `metrics` and `logger` objects shown in the above example must satisfy the [MetricsFactory](./src/_flow/metrics.js#L34) and [Logger](./src/_flow/logger.js) APIs respectively.\n\n#### Prometheus metrics\n\nThis module brings a [Prometheus(prom-client)](https://www.npmjs.com/package/prom-client) integration to the internal Jaeger metrics. The way to initialize the tracer with Prometheus metrics:\n\n```javascript\nvar PrometheusMetricsFactory = require('jaeger-client').PrometheusMetricsFactory;\nvar promClient = require('prom-client');\n\nvar config = {\n  serviceName: 'my-awesome-service',\n};\nvar namespace = config.serviceName;\nvar metrics = new PrometheusMetricsFactory(promClient, namespace);\nvar options = {\n  metrics: metrics,\n};\nvar tracer = initTracer(config, options);\n```\n\n## Usage\n\nThe Tracer instance created by `initTracer` is OpenTracing-1.0 compliant. See [opentracing-javascript](https://github.com/opentracing/opentracing-javascript) for usage examples. Ensure that `tracer.close()` is called on application exit to flush buffered traces.\n\n### TChannel Span Bridging\n\nBecause [tchannel-node](https://github.com/uber/tchannel-node) does not have instrumentation for OpenTracing, Jaeger-Client exposes methods wrapping tchannel handlers, and encoded channels. An encoded channel is a channel wrapped in either a thrift encoder `TChannelAsThrift`, or json encoder `TChannelAsJson`. To wrap a server handler for thrift one can initialize a tchannel bridge, and wrap the encoded handler function with a `tracedHandler` decorator. The tchannel bridge takes an OpenTracing tracer, and a context factory. The context factory must be a function that returns a context with the methods 'getSpan', and 'setSpan' which retrieve and assign the span to the context respectively.\n\n```javascript\nimport { TChannelBridge } from 'jaeger-client';\nimport Context from 'some-conformant-context';\n\nfunction contextFactory() {\n  return new Context();\n}\n\nlet bridge = new TChannelBridge(tracer, { contextFactory: contextFactory });\nlet server = new TChannel({ serviceName: 'server' });\nserver.listen(4040, '127.0.0.1');\nlet serverThriftChannel = TChannelAsThrift({\n  channel: server,\n  entryPoint: path.join(__dirname, 'thrift', 'echo.thrift'), // file path to a thrift file\n});\n\nlet perProcessOptions = {};\nserverThriftChannel.register(\n  server,\n  'Echo::echo',\n  perProcessOptions,\n  bridge.tracedHandler((perProcessOptions, req, head, body, callback) =\u003e {\n    /* Your handler code goes here. */\n  })\n);\n```\n\nOutbound calls can be made in two ways, shown below.\n\n#### Using encoded channel to create a request and calling `request.send()`\n\n```javascript\nimport { TChannelBridge } from 'jaeger-client';\n\nlet bridge = new TChannelBridge(tracer);\n// Create the toplevel client channel.\nlet client = new TChannel();\n\n// Create the client subchannel that makes requests.\nlet clientSubChannel = client.makeSubChannel({\n  serviceName: 'server',\n  peers: ['127.0.0.1:4040'],\n});\n\nlet encodedThriftChannel = TChannelAsThrift({\n  channel: clientSubChannel,\n  entryPoint: path.join(__dirname, 'thrift', 'echo.thrift'), // file path to a thrift file\n});\n\n// wrap encodedThriftChannel in a tracing decorator\nlet tracedChannel = bridge.tracedChannel(encodedThriftChannel);\n\n// The encodedThriftChannel's (also true for json encoded channels) request object can call 'send' directly.\nlet req = tracedChannel.request({\n  serviceName: 'server',\n  context: context, // must be passed through from the service handler shown above\n  headers: { cn: 'echo' },\n});\n\n// headers should contain your outgoing tchannel headers if any.\n// In this instance 'send' is being called on the request object, and not the channel.\nreq.send('Echo::echo', headers, { value: 'some-string' });\n```\n\n#### Using top level channel to create a request and calling `encodedChannel.send(request)`\n\n```javascript\nlet tracedChannel = bridge.tracedChannel(encodedThriftChannel);\n\n// tracedChannel.channel refers to encodedThriftChannel's inner channel which\n// is clientSubChannel in this instance.\nlet req = tracedChannel.channel.request({\n  serviceName: 'server',\n  headers: { cn: 'echo' },\n  context: context, // must be passed through from the service handler shown above\n  timeout: someTimeout,\n});\n// send() can be called directly on the tracing decorator\ntracedChannel.send(req, 'Echo::echo', o.headers, { value: 'some-string' }, clientCallback);\n```\n\n### Debug Traces (Forced Sampling)\n\n#### Programmatically\n\nThe OpenTracing API defines a `sampling.priority` standard tag that can be used to affect the sampling of a span and its children:\n\n```javascript\nspan.setTag(opentracing_tags.SAMPLING_PRIORITY, 1);\n```\n\n#### Via HTTP Headers\n\nJaeger Tracer also understands a special HTTP Header `jaeger-debug-id`, which can be set in the incoming request, e.g.\n\n```sh\ncurl -H \"jaeger-debug-id: some-correlation-id\" http://myhost.com\n```\n\nWhen Jaeger sees this header in the request that otherwise has no tracing context, it ensures that the new trace started for this request will be sampled in the \"debug\" mode (meaning it should survive all downsampling that might happen in the collection pipeline), and the root span will have a tag as if this statement was executed:\n\n```javascript\nspan.setTag('jaeger-debug-id', 'some-correlation-id');\n```\n\nThis allows using Jaeger UI to find the trace by this tag.\n\n### Trace Buffer\n\nSpecify the reporter's flush interval (ms) with `config.reporter.flushIntervalMs` or `JAEGER_REPORTER_FLUSH_INTERVAL`. The default is 1000 ms.\n\nCalling `.close()` on the tracer will properly flush and close composed objects, including the reporter and sampler. This prevents dropped traces in the event of an error or unexpected early termination prior to normal periodic flushing.\n\n```javascript\ntracer.close(cb?)\n```\n\n### Zipkin Compatibility\n\nSupport for [Zipkin's B3 Propagation HTTP headers](https://github.com/openzipkin/b3-propagation) is provided by the `ZipkinB3TextMapCodec`, which can be configured instead of the default `TextMapCodec`.\n\nThe new codec can be used by registering it with a tracer instance as both an injector and an extractor:\n\n```\nlet codec = new ZipkinB3TextMapCodec({ urlEncoding: true });\n\ntracer.registerInjector(opentracing.FORMAT_HTTP_HEADERS, codec);\ntracer.registerExtractor(opentracing.FORMAT_HTTP_HEADERS, codec);\n```\n\nThis can prove useful when compatibility with existing Zipkin tracing/instrumentation is desired.\n\n### Webpack Compatibility\n\nIn order to bundle the library using webpack, e.g. for uploading code to an AWS Lambda function, it is required to copy the Jaeger thrift definition file into the output directory of the bundle:\n\n```js\n{\n  plugins: [\n    new CopyPlugin([\n      {\n        from: require.resolve('jaeger-client/dist/src/jaeger-idl/thrift/jaeger.thrift'),\n        to: 'jaeger-idl/thrift/jaeger.thrift',\n      },\n      {\n        from: require.resolve('jaeger-client/dist/src/thriftrw-idl/agent.thrift'),\n        to: 'thriftrw-idl/agent.thrift',\n      },\n    ]),\n  ];\n}\n```\n\n## License\n\n[Apache 2.0 License](./LICENSE).\n\n[ci-img]: https://github.com/jaegertracing/jaeger-client-node/workflows/Unit%20Tests/badge.svg?branch=master\n[ci]: https://github.com/jaegertracing/jaeger-client-node/actions?query=branch%3Amaster\n[cov-img]: https://codecov.io/gh/jaegertracing/jaeger-client-node/branch/master/graph/badge.svg\n[cov]: https://codecov.io/gh/jaegertracing/jaeger-client-node/branch/master/\n[npm-img]: https://badge.fury.io/js/jaeger-client.svg\n[npm]: https://www.npmjs.com/package/jaeger-client\n[ot-img]: https://img.shields.io/badge/OpenTracing--1.0-enabled-blue.svg\n[ot-url]: http://opentracing.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaegertracing%2Fjaeger-client-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaegertracing%2Fjaeger-client-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaegertracing%2Fjaeger-client-node/lists"}