[go: nahoru, domu]

Skip to content

Commit

Permalink
refactor: OpenTracingPropagator -> OTTracePropagator rename (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwear authored Feb 1, 2021
1 parent d59bd00 commit eb7ebd1
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# OpenTelemetry Propagator OpenTracing
# OpenTelemetry OTTracePropagator

[![Gitter chat][gitter-image]][gitter-url]
[![NPM Published Version][npm-img]][npm-url]
[![dependencies][dependencies-image]][dependencies-url]
[![devDependencies][devdependencies-image]][devdependencies-url]
[![Apache License][license-image]][license-image]

## OpenTracing Format
## OT Trace Format

| Header Name | Description | Required |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
Expand All @@ -17,7 +17,7 @@

### Interop and trace ids

The OpenTracing propagation format expects trace ids to be 64-bits. In order to
The OT trace propagation format expects trace ids to be 64-bits. In order to
interop with OpenTelemetry, trace ids need to be truncated to 64-bits before
sending them on the wire. When truncating, the least significant (right-most)
bits MUST be retained. For example, a trace id of
Expand All @@ -29,7 +29,7 @@ Baggage keys and values are validated according to [rfc7230][rfc7230-url]. Any
keys or values that would result in invalid HTTP headers will be silently
dropped during inject.

OpenTelemetry Baggage is represented as multiple headers where the
OT Baggage is represented as multiple headers where the
names are carrier dependent. For this reason, they are omitted from the `fields`
method. This behavior should be taken into account if your application relies
on the `fields` functionality. See the [specification][fields-spec-url] for
Expand All @@ -39,11 +39,9 @@ more details.

```javascript
const api = require('@opentelemetry/api');
const {
OpenTracingPropagator,
} = require('@opentelemetry/propagator-opentracing');
const { OTTracePropagator } = require('@opentelemetry/propagator-ot-trace');

api.propagation.setGlobalPropagator(new OpenTracingPropagator());
api.propagation.setGlobalPropagator(new OTTracePropagator());
```

## Useful links
Expand All @@ -60,11 +58,11 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/master/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib/status.svg?path=packages/opentelemetry-propagator-opentracing
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=packages%2Fopentelemetry-propagator-opentracing
[devdependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib/dev-status.svg?path=packages/opentelemetry-propagator-opentracing
[devdependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=packages%2Fopentelemetry-propagator-opentracing&type=dev
[npm-url]: https://www.npmjs.com/package/@opentelemetry/propagator-opentracing
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fpropagator-opentracing.svg
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib/status.svg?path=packages/opentelemetry-propagator-ot-trace
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=packages%2Fopentelemetry-propagator-ot-trace
[devdependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib/dev-status.svg?path=packages/opentelemetry-propagator-ot-trace
[devdependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-contrib?path=packages%2Fopentelemetry-propagator-ot-trace&type=dev
[npm-url]: https://www.npmjs.com/package/@opentelemetry/propagator-ot-trace
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fpropagator-ot-trace.svg
[rfc7230-url]: https://tools.ietf.org/html/rfc7230#section-3.2
[fields-spec-url]: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/context/api-propagators.md#fields
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@opentelemetry/propagator-opentracing",
"name": "@opentelemetry/propagator-ot-trace",
"version": "0.13.0",
"description": "OpenTelemetry propagator OpenTracing provides context propagation for systems that are using the OpenTracing header format",
"description": "The OpenTelemetry OTTracepropagator implements the propagation format used by the \"basic tracer\" implementations from the OpenTracing project",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js-contrib",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ function isValidHeaderValue(value: string): boolean {
}

/**
* Propagator for the OpenTracing HTTP format.
* Propagator for the ot-trace HTTP format from OpenTracing.
*/
export class OpenTracingPropagator implements TextMapPropagator {
export class OTTracePropagator implements TextMapPropagator {
inject(context: Context, carrier: unknown, setter: TextMapSetter) {
const spanContext = getSpanContext(context);
if (!spanContext || !isSpanContextValid(spanContext)) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

export * from './OpenTracingPropagator';
export * from './OTTracePropagator';
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ import {
} from '@opentelemetry/api';
import * as assert from 'assert';
import {
OpenTracingPropagator,
OTTracePropagator,
OT_TRACE_ID_HEADER,
OT_SPAN_ID_HEADER,
OT_SAMPLED_HEADER,
OT_BAGGAGE_PREFIX,
} from '../src/OpenTracingPropagator';
} from '../src/OTTracePropagator';

describe('OpenTracingPropagator', () => {
const propagator = new OpenTracingPropagator();
describe('OTTracePropagator', () => {
const propagator = new OTTracePropagator();
let carrier: { [key: string]: unknown };

beforeEach(() => {
Expand Down

0 comments on commit eb7ebd1

Please sign in to comment.