Skip to content

Commit 7119c17

Browse files
authored
Merge branch 'master' into feat/batch-observer
2 parents b5485fc + 74d6e45 commit 7119c17

85 files changed

Lines changed: 622 additions & 439 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Last updated March 2020
108108
| Metrics | Beta | v0.3 | Beta |
109109
| Context | Beta | v0.3 | Beta |
110110
| Propagation | Beta | v0.3 | Beta |
111-
| Correlation Context | Alpha | v0.3 | Development |
111+
| Baggage | Alpha | v0.3 | Development |
112112
| OpenTracing Bridge | N/A | v0.3 | Beta |
113113
| Resources | N/A | v0.3 | Beta |
114114

getting-started/ts-example/example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"license": "Apache-2.0",
1111
"devDependencies": {
1212
"@types/express": "4.17.9",
13-
"@types/node": "14.14.10",
13+
"@types/node": "14.14.12",
1414
"ts-node": "8.10.2"
1515
},
1616
"dependencies": {

getting-started/ts-example/monitored-example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"license": "Apache-2.0",
1111
"devDependencies": {
1212
"@types/express": "4.17.9",
13-
"@types/node": "14.14.10",
13+
"@types/node": "14.14.12",
1414
"ts-node": "8.10.2"
1515
},
1616
"dependencies": {

getting-started/ts-example/traced-example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"license": "Apache-2.0",
1111
"devDependencies": {
1212
"@types/express": "4.17.9",
13-
"@types/node": "14.14.10",
14-
"ts-node": "9.0.0"
13+
"@types/node": "14.14.12",
14+
"ts-node": "9.1.1"
1515
},
1616
"dependencies": {
1717
"@opentelemetry/core": "^0.13.0",

integration-tests/propagation-validation-server/validation-server.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const axios = require("axios");
22
const { HttpTraceContext } = require("@opentelemetry/core");
33
const { BasicTracerProvider } = require("@opentelemetry/tracing");
4-
const { context, propagation, trace } = require("@opentelemetry/api");
4+
const { context, propagation, trace, ROOT_CONTEXT } = require("@opentelemetry/api");
55
const {
66
AsyncHooksContextManager,
77
} = require("@opentelemetry/context-async-hooks");
@@ -31,14 +31,14 @@ app.use(bodyParser.json());
3131

3232
// Mount our demo route
3333
app.post("/verify-tracecontext", (req, res) => {
34-
context.with(propagation.extract(req.headers), () => {
34+
context.with(propagation.extract(ROOT_CONTEXT, req.headers), () => {
3535
Promise.all(
3636
req.body.map((action) => {
3737
const span = tracer.startSpan("propagate-w3c");
3838
let promise;
3939
tracer.withSpan(span, () => {
4040
const headers = {};
41-
propagation.inject(headers);
41+
propagation.inject(context.active(), headers);
4242
promise = axios
4343
.post(
4444
action.url,
@@ -57,8 +57,8 @@ app.post("/verify-tracecontext", (req, res) => {
5757
return promise;
5858
})
5959
)
60-
.then(() => res.send("hello"))
61-
.catch((err) => res.status(500).send(err));
60+
.then(() => res.send("hello"))
61+
.catch((err) => res.status(500).send(err));
6262
});
6363
});
6464

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@
4343
"devDependencies": {
4444
"@commitlint/cli": "11.0.0",
4545
"@commitlint/config-conventional": "11.0.0",
46-
"@typescript-eslint/eslint-plugin": "4.9.0",
47-
"@typescript-eslint/parser": "4.9.0",
46+
"@typescript-eslint/eslint-plugin": "4.9.1",
47+
"@typescript-eslint/parser": "4.9.1",
4848
"beautify-benchmark": "0.2.4",
4949
"benchmark": "2.1.4",
50-
"eslint": "7.14.0",
50+
"eslint": "7.15.0",
5151
"eslint-config-airbnb-base": "14.2.1",
5252
"eslint-plugin-header": "3.1.0",
5353
"eslint-plugin-import": "2.22.1",
5454
"gh-pages": "3.1.0",
5555
"gts": "2.0.2",
56-
"husky": "4.3.0",
56+
"husky": "4.3.5",
5757
"lerna": "3.22.1",
5858
"lerna-changelog": "1.0.1",
5959
"markdownlint-cli": "0.25.0",

packages/opentelemetry-api/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
"@opentelemetry/context-base": "^0.13.0"
5656
},
5757
"devDependencies": {
58-
"@types/mocha": "8.0.4",
59-
"@types/node": "14.14.10",
58+
"@types/mocha": "8.2.0",
59+
"@types/node": "14.14.12",
6060
"@types/sinon": "9.0.9",
6161
"@types/webpack-env": "1.16.0",
6262
"codecov": "3.8.1",
@@ -68,11 +68,11 @@
6868
"karma-mocha": "2.0.1",
6969
"karma-spec-reporter": "0.0.32",
7070
"karma-webpack": "4.0.2",
71-
"linkinator": "2.4.0",
71+
"linkinator": "2.8.0",
7272
"mocha": "7.2.0",
7373
"nyc": "15.1.0",
74-
"sinon": "9.2.1",
75-
"ts-loader": "8.0.11",
74+
"sinon": "9.2.2",
75+
"ts-loader": "8.0.12",
7676
"ts-mocha": "8.0.0",
7777
"typedoc": "0.19.2",
7878
"typescript": "3.9.7",

packages/opentelemetry-api/src/api/propagation.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@ import {
2323
TextMapPropagator,
2424
TextMapSetter,
2525
} from '../context/propagation/TextMapPropagator';
26-
import { ContextAPI } from './context';
2726
import {
2827
API_BACKWARDS_COMPATIBILITY_VERSION,
2928
GLOBAL_PROPAGATION_API_KEY,
3029
makeGetter,
3130
_global,
3231
} from './global-utils';
3332

34-
const contextApi = ContextAPI.getInstance();
35-
3633
/**
3734
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
3835
*/
@@ -72,29 +69,29 @@ export class PropagationAPI {
7269
/**
7370
* Inject context into a carrier to be propagated inter-process
7471
*
72+
* @param context Context carrying tracing data to inject
7573
* @param carrier carrier to inject context into
7674
* @param setter Function used to set values on the carrier
77-
* @param context Context carrying tracing data to inject. Defaults to the currently active context.
7875
*/
7976
public inject<Carrier>(
77+
context: Context,
8078
carrier: Carrier,
81-
setter: TextMapSetter<Carrier> = defaultTextMapSetter,
82-
context: Context = contextApi.active()
79+
setter: TextMapSetter<Carrier> = defaultTextMapSetter
8380
): void {
8481
return this._getGlobalPropagator().inject(context, carrier, setter);
8582
}
8683

8784
/**
8885
* Extract context from a carrier
8986
*
87+
* @param context Context which the newly created context will inherit from
9088
* @param carrier Carrier to extract context from
9189
* @param getter Function used to extract keys from a carrier
92-
* @param context Context which the newly created context will inherit from. Defaults to the currently active context.
9390
*/
9491
public extract<Carrier>(
92+
context: Context,
9593
carrier: Carrier,
96-
getter: TextMapGetter<Carrier> = defaultTextMapGetter,
97-
context: Context = contextApi.active()
94+
getter: TextMapGetter<Carrier> = defaultTextMapGetter
9895
): Context {
9996
return this._getGlobalPropagator().extract(context, carrier, getter);
10097
}

packages/opentelemetry-api/src/correlation_context/CorrelationContext.ts renamed to packages/opentelemetry-api/src/baggage/Baggage.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
import { EntryValue } from './EntryValue';
1818

1919
/**
20-
* CorrelationContext represents collection of entries. Each key of
21-
* CorrelationContext is associated with exactly one value. CorrelationContext
20+
* Baggage represents collection of entries. Each key of
21+
* Baggage is associated with exactly one value. Baggage
2222
* is serializable, to facilitate propagating it not only inside the process
23-
* but also across process boundaries. CorrelationContext is used to annotate
23+
* but also across process boundaries. Baggage is used to annotate
2424
* telemetry with the name:value pair Entry. Those values can be used to add
2525
* dimension to the metric or additional contest properties to logs and traces.
2626
*/
27-
export interface CorrelationContext {
27+
export interface Baggage {
2828
[entryKey: string]: EntryValue;
2929
}

packages/opentelemetry-api/src/correlation_context/EntryValue.ts renamed to packages/opentelemetry-api/src/baggage/EntryValue.ts

File renamed without changes.

0 commit comments

Comments
 (0)