From 2382ae81fa7b3af981206b6c9c6a5e7fa5b9c11c Mon Sep 17 00:00:00 2001 From: svrnm Date: Thu, 20 Jun 2024 14:27:41 +0200 Subject: [PATCH 1/9] Update propagation page for Node.js Signed-off-by: svrnm --- content/en/docs/languages/js/propagation.md | 497 +++++++++++++++++- .../shortcodes/docs/languages/propagation.md | 24 + static/refcache.json | 4 + 3 files changed, 500 insertions(+), 25 deletions(-) create mode 100644 layouts/shortcodes/docs/languages/propagation.md diff --git a/content/en/docs/languages/js/propagation.md b/content/en/docs/languages/js/propagation.md index bca4b04b4ef7..eeff5157ff38 100644 --- a/content/en/docs/languages/js/propagation.md +++ b/content/en/docs/languages/js/propagation.md @@ -4,49 +4,254 @@ description: Context propagation for the JS SDK weight: 65 --- -Propagation is the mechanism that moves data between services and processes. -Although not limited to tracing, it is what allows traces to build causal -information about a system across services that are arbitrarily distributed -across process and network boundaries. +{{% docs/languages/propagation js %}} -## Context propagation with libraries +## Automatic context propagations -For the vast majority of use cases, context propagation is done with -instrumentation libraries. +[Instrumentation libraries](../libraries) like +[`@opentelemetry/instrumentation-http`](https://www.npmjs.com/package/@opentelemetry/instrumentation-http) +or +[`@opentelemetry/instrumentation-express`](https://www.npmjs.com/package/@opentelemetry/instrumentation-http) +propagate context across services for you. -For example, if you have several Node.js services that communicate over HTTP, -you can use the -[`express`](https://www.npmjs.com/package/@opentelemetry/instrumentation-express) -and [`http`](https://www.npmjs.com/package/@opentelemetry/instrumentation-http) -instrumentation libraries to automatically propagate trace context across -services for you. +If you followed the [Getting Started Guide](../getting-started/nodejs) you can +create a client application that queries the `/rolldice` endpoint. -**It is highly recommend that you use instrumentation libraries to propagate -context.** Although it is possible to propagate context manually, if your system -uses libraries to communicate between services, use a matching instrumentation -library to propagate context. +{{% alert title="Note" %}} -Refer to [Libraries](/docs/languages/js/libraries) to learn more about -instrumentation libraries and how to use them. +You can combine this example with the sample application from the Getting +Started guide of any other language as well! Correlation works across +applications written in different languages without any differences. -## Manual W3C Trace Context Propagation +{{% /alert %}} -In some cases, it is not possible to propagate context with an instrumentation -library. There may not be an instrumentation library that matches a library -you're using to have services communicate with one another. Or you many have -requirements that instrumentation libraries cannot fulfill, even if they exist. +Start by creating a new folder called `dice-client` and install the required +dependencies: + +{{< tabpane text=true >}} {{% tab TypeScript %}} + +```sh +npm init -y +npm install typescript \ + ts-node \ + @types/node \ + undici \ + @opentelemetry/instrumentation-undici \ + @opentelemetry/sdk-node \ + +# initialize typescript +npx tsc --init +``` + +{{% /tab %}} {{% tab JavaScript %}} + +```sh +npm init -y +npm install undici \ + @opentelemetry/instrumentation-undici \ + @opentelemetry/sdk-node \ +``` + +{{% /tab %}} {{< /tabpane >}} + +Next, create a new file called `client.ts` (or client.js) with the following +content: + +{{< tabpane text=true >}} {{% tab TypeScript %}} + +```ts +import { NodeSDK } from '@opentelemetry/sdk-node'; +import { + SimpleSpanProcessor, + ConsoleSpanExporter, +} from '@opentelemetry/sdk-trace-node'; +import { UndiciInstrumentation } from '@opentelemetry/instrumentation-undici'; +import { request } from 'undici'; + +const sdk = new NodeSDK({ + spanProcessors: [new SimpleSpanProcessor(new ConsoleSpanExporter())], + instrumentations: [new UndiciInstrumentation()], +}); + +sdk.start(); + +request('http://localhost:8080/rolldice').then((response) => { + response.body.json().then((json: any) => console.log(json)); +}); +``` + +{{% /tab %}} {{% tab JavaScript %}} + +```js +const { NodeSDK } = require('@opentelemetry/sdk-node'); +const { + SimpleSpanProcessor, + ConsoleSpanExporter, +} = require('@opentelemetry/sdk-trace-node'); +const { + UndiciInstrumentation, +} = require('@opentelemetry/instrumentation-undici'); + +const sdk = new NodeSDK({ + spanProcessors: [new SimpleSpanProcessor(new ConsoleSpanExporter())], + instrumentations: [new UndiciInstrumentation()], +}); +sdk.start(); + +const { request } = require('undici'); + +request('http://localhost:8080/rolldice').then((response) => { + response.body.json().then((json) => console.log(json)); +}); +``` + +{{% /tab %}} {{% /tabpane %}} + +Make sure that you have the instrumented version of `app.ts` (or `app.js`) from +the [Getting Started](../getting-started/nodejs) running in one shell: + +{{< tabpane text=true >}} {{% tab TypeScript %}} + +```console +$ npx ts-node --require ./instrumentation.ts app.ts +Listening for requests on http://localhost:8080 +``` + +{{% /tab %}} {{% tab JavaScript %}} + +```console +$ node --require ./instrumentation.js app.js +Listening for requests on http://localhost:8080 +``` + +{{% /tab %}} {{< /tabpane >}} + +Start a second shell and run the `client.ts` (or `client.js`): + +{{< tabpane text=true >}} {{% tab TypeScript %}} + +```shell +npx ts-node client.ts +``` + +{{% /tab %}} {{% tab JavaScript %}} + +```shell +node client.js +``` + +{{% /tab %}} {{< /tabpane >}} + +Both shells should emit span details to the console. The client output looks +similar to the following: + +```javascript {hl_lines=[7,11]} +{ + resource: { + attributes: { + // ... + } + }, + traceId: 'cccd19c3a2d10e589f01bfe2dc896dc2', + parentId: undefined, + traceState: undefined, + name: 'GET', + id: '6f64ce484217a7bf', + kind: 2, + timestamp: 1718875320295000, + duration: 19836.833, + attributes: { + 'url.full': 'http://localhost:8080/rolldice', + // ... + }, + status: { code: 0 }, + events: [], + links: [] +} +``` + +Take note of the traceId (`cccd19c3a2d10e589f01bfe2dc896dc2`) and ID +(`6f64ce484217a7bf`). Both can be find in the output of client as well: + +```javascript {hl_lines=["6-7"]} +{ + resource: { + attributes: { + // ... + }, + traceId: 'cccd19c3a2d10e589f01bfe2dc896dc2', + parentId: '6f64ce484217a7bf', + traceState: undefined, + name: 'GET /rolldice', + id: '027c5c8b916d29da', + kind: 1, + timestamp: 1718875320310000, + duration: 3894.792, + attributes: { + 'http.url': 'http://localhost:8080/rolldice', + // ... + }, + status: { code: 0 }, + events: [], + links: [] +} +``` + +Your client and server application successfully report connected spans. If you +send both to a backend now the visualization will show this dependency for you. + +## Manual context propagation + +In some cases, it is not possible to propagate context automatically as outlined +above. There may not be an instrumentation library that matches a library you're +using to have services communicate with one another. Or you many have +requirements these libraries cannot fulfill, even if they exist. When you must propagate context manually, you can use the [context API](/docs/languages/js/context). +### Generic example + The following generic example demonstrates how you can propagate trace context manually. First, on the sending service, you'll need to inject the current `context`: +{{< tabpane text=true >}} {{% tab TypeScript %}} + +```typescript +// Sending service +import { Context, propagation, trace } from '@opentelemetry/api'; + +// Define an interface for the output object that will hold the trace information. +interface Carrier { + traceparent?: string; + tracestate?: string; +} + +// Create an output object that conforms to that interface. +const output: Carrier = {}; + +// Serialize the traceparent and tracestate from context into +// an output object. +// +// This example uses the active trace context, but you can +// use whatever context is appropriate to your scenario. +propagation.inject(trace.getTracerProvider().getActiveContext(), output); + +// Extract the traceparent and tracestate values from the output object. +const { traceparent, tracestate } = output; + +// You can then pass the traceparent and tracestate +// data to whatever mechanism you use to propagate +// across services. +``` + +{{% /tab %}} {{% tab JavaScript %}} + ```js // Sending service -import { context, propagation, trace } from '@opentelemetry/api'; +const { context, propagation } = require('@opentelemetry/api'); const output = {}; // Serialize the traceparent and tracestate from context into @@ -62,9 +267,51 @@ const { traceparent, tracestate } = output; // across services. ``` +{{% /tab %}} {{< /tabpane >}} + On the receiving service, you'll need to extract `context` (for example, from parsed HTTP headers) and then set them as the current trace context. +{{< tabpane text=true >}} {{% tab TypeScript %}} + +```typescript +// Receiving service +import { Context, propagation, trace, Span } from '@opentelemetry/api'; + +// Define an interface for the input object that includes 'traceparent' & 'tracestate'. +interface Carrier { + traceparent?: string; + tracestate?: string; +} + +// Assume "input" is an object with 'traceparent' & 'tracestate' keys. +const input: Carrier = {}; + +// Extracts the 'traceparent' and 'tracestate' data into a context object. +// +// You can then treat this context as the active context for your +// traces. +let activeContext: Context = propagation.extract( + trace.getTracerProvider().getActiveContext(), + input, +); + +let tracer = trace.getTracer('app-name'); + +let span: Span = tracer.startSpan( + spanName, + { + attributes: {}, + }, + activeContext, +); + +// Set the created span as active in the deserialized context. +trace.setSpan(activeContext, span); +``` + +{{% /tab %}} {{% tab JavaScript %}} + ```js // Receiving service import { context, propagation, trace } from '@opentelemetry/api'; @@ -92,8 +339,208 @@ let span = tracer.startSpan( trace.setSpan(activeContext, span); ``` +{{% /tab %}} {{< /tabpane >}} + From there, when you have a deserialized active context, you can create spans that will be a part of the same trace from the other service. You can also use the [Context](/docs/languages/js/context) API to modify or set the deserialized context in other ways. + +### Custom protocol example + +A common use case for when you need to propagate context manually is when you +use a custom protocol between services for communication. The following example +uses a basic text-based TCP protocol to send a serialized object from one +service to another. + +Start with creating a new folder called `propagation-example` and initialize it +with dependencies as follows: + +```shell +npm init -y +npm install @opentelemetry/api @opentelemetry/sdk-node +``` + +Next create files `client.js` and `server.js` with the following content: + +```javascript +// client.js +const net = require('net'); +const { context, propagation, trace } = require('@opentelemetry/api'); + +let tracer = trace.getTracer('client'); + +// Connect to the server +const client = net.createConnection({ port: 8124 }, () => { + // Send the serialized object to the server + let span = tracer.startActiveSpan('send', { kind: 1 }, (span) => { + const output = {}; + propagation.inject(context.active(), output); + const { traceparent, tracestate } = output; + + const objToSend = { key: 'value' }; + + if (traceparent) { + objToSend._meta = { traceparent, tracestate }; + } + + client.write(JSON.stringify(objToSend), () => { + client.end(); + span.end(); + }); + }); +}); +``` + +```javascript +// server.js +const net = require('net'); +const { context, propagation, trace } = require('@opentelemetry/api'); + +let tracer = trace.getTracer('server'); + +const server = net.createServer((socket) => { + socket.on('data', (data) => { + const message = data.toString(); + // Parse the JSON object received from the client + try { + const json = JSON.parse(message); + let activeContext = context.active(); + if (json._meta) { + activeContext = propagation.extract(context.active(), json._meta); + delete json._meta; + } + span = tracer.startSpan('receive', { kind: 1 }, activeContext); + trace.setSpan(activeContext, span); + console.log('Parsed JSON:', json); + } catch (e) { + console.error('Error parsing JSON:', e.message); + } finally { + span.end(); + } + }); +}); + +// Listen on port 8124 +server.listen(8124, () => { + console.log('Server listening on port 8124'); +}); +``` + +Start a first shell to run the server: + +```console +$ node server.js +Server listening on port 8124 +``` + +Then in a second shell run the client: + +```shell +node client.js +``` + +The client should terminate immediately and the server should output the +following: + +```text +Parsed JSON: { key: 'value' } +``` + +Since the example so far only took dependency on the OpenTelemetry API all calls +to it are [no-op instructions]() and +the client and server behave as if OpenTelemetry is not used. + +{{% alert title="Note" color="warning" %}} + +This is especially important if your server and client code are libraries, since +they should only use the OpenTelemetry API. To understand why, read the [concept +page on how to add instrumentation to your library]((/docs/concepts/instrumentation/libraries/). + +{{% /alert %}} + +To enable OpenTelemetry and to see the context propagation in action, create an +additional file called `instrumentation.js` with the following content: + +```javascript +// instrumentation.js +const { NodeSDK } = require('@opentelemetry/sdk-node'); +const { + ConsoleSpanExporter, + SimpleSpanProcessor, +} = require('@opentelemetry/sdk-trace-node'); + +const sdk = new NodeSDK({ + spanProcessors: [new SimpleSpanProcessor(new ConsoleSpanExporter())], +}); + +sdk.start(); +``` + +Use this file to run both, the server and the client, with instrumentation +enabled: + +```console +$ node -r ./instrumentation.js server.js +Server listening on port 8124 +``` + +and + +```shell +node -r ./instrumentation client.js +``` + +After the client has send data to the server and terminated you should see spans +being print to the console on both shells. + +The output for the client looks like the following: + +```javascript {hl_lines=[7,11]} +{ + resource: { + attributes: { + // ... + } + }, + traceId: '4b5367d540726a70afdbaf49240e6597', + parentId: undefined, + traceState: undefined, + name: 'send', + id: '92f125fa335505ec', + kind: 1, + timestamp: 1718879823424000, + duration: 1054.583, + // ... +} +``` + +The output for the server looks like the following: + +```javascript {hl_lines=[7,8]} +{ + resource: { + attributes: { + // ... + } + }, + traceId: '4b5367d540726a70afdbaf49240e6597', + parentId: '92f125fa335505ec', + traceState: undefined, + name: 'receive', + id: '53da0c5f03cb36e5', + kind: 1, + timestamp: 1718879823426000, + duration: 959.541, + // ... +} +``` + +Similar to the [manual example](#manual-context-propagation) the spans are +connected via the `traceId` and the `id`/`parentId`. + +## Next Steps + +To learn more about propagation, read the +[Propagators API specification](/docs/specs/otel/context/api-propagators/). diff --git a/layouts/shortcodes/docs/languages/propagation.md b/layouts/shortcodes/docs/languages/propagation.md new file mode 100644 index 000000000000..a6b9d62e19db --- /dev/null +++ b/layouts/shortcodes/docs/languages/propagation.md @@ -0,0 +1,24 @@ +{{ $lang := .Get 0 | default "" -}} + +With context propagation, [Signals](/docs/concepts/signals) can be correlated +with each other, regardless of where they are generated. Although not limited to +tracing, context propagation allows [traces](/docs/concepts/signals/traces) to +build causal information about a system across services that are arbitrarily +distributed across process and network boundaries. + +For the vast majority of use cases, libraries that natively support +OpenTelemetry or [instrumentation libraries](../libraries) will automatically +propagate trace context across services for you. Only in rare cases you will +need to propagate context manually. + +{{ if $lang -}} + +To learn more about context propagation, read the +[concept page about it](/docs/concepts/context-propagation). + +{{ else -}} + +To understand context propagation, you need to understand two separate concepts: +context and propagation. + +{{ end -}} diff --git a/static/refcache.json b/static/refcache.json index 49330b5568dd..5b1958b3227c 100644 --- a/static/refcache.json +++ b/static/refcache.json @@ -1919,6 +1919,10 @@ "StatusCode": 200, "LastSeen": "2024-01-18T19:01:58.384313-05:00" }, + "https://en.wikipedia.org/wiki/NOP_%28code%29": { + "StatusCode": 200, + "LastSeen": "2024-06-20T14:19:37.174208+02:00" + }, "https://en.wikipedia.org/wiki/Non-uniform_memory_access": { "StatusCode": 200, "LastSeen": "2024-01-18T19:02:21.989727-05:00" From 103062e3b674aed66b51404b2a82f024941c2075 Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Thu, 20 Jun 2024 16:24:34 +0200 Subject: [PATCH 2/9] Apply suggestions from code review Co-authored-by: Fabrizio Ferri-Benedetti --- content/en/docs/languages/js/propagation.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/content/en/docs/languages/js/propagation.md b/content/en/docs/languages/js/propagation.md index eeff5157ff38..f4a7273ddd15 100644 --- a/content/en/docs/languages/js/propagation.md +++ b/content/en/docs/languages/js/propagation.md @@ -20,7 +20,7 @@ create a client application that queries the `/rolldice` endpoint. {{% alert title="Note" %}} You can combine this example with the sample application from the Getting -Started guide of any other language as well! Correlation works across +Started guide of any other language as well. Correlation works across applications written in different languages without any differences. {{% /alert %}} @@ -203,9 +203,9 @@ send both to a backend now the visualization will show this dependency for you. ## Manual context propagation In some cases, it is not possible to propagate context automatically as outlined -above. There may not be an instrumentation library that matches a library you're -using to have services communicate with one another. Or you many have -requirements these libraries cannot fulfill, even if they exist. +in previous section. There might not be an instrumentation library that matches +a library you're using to have services communicate with one another. Or you +might have requirements that these libraries can't fulfill even if they existed. When you must propagate context manually, you can use the [context API](/docs/languages/js/context). @@ -460,7 +460,7 @@ page on how to add instrumentation to your library]((/docs/concepts/instrumentat {{% /alert %}} -To enable OpenTelemetry and to see the context propagation in action, create an +To enable OpenTelemetry and see the context propagation in action, create an additional file called `instrumentation.js` with the following content: ```javascript @@ -492,8 +492,8 @@ and node -r ./instrumentation client.js ``` -After the client has send data to the server and terminated you should see spans -being print to the console on both shells. +After the client has sent data to the server and terminated you should see spans +in the console output of both shells. The output for the client looks like the following: @@ -538,9 +538,9 @@ The output for the server looks like the following: ``` Similar to the [manual example](#manual-context-propagation) the spans are -connected via the `traceId` and the `id`/`parentId`. +connected using the `traceId` and the `id`/`parentId`. -## Next Steps +## Next steps To learn more about propagation, read the [Propagators API specification](/docs/specs/otel/context/api-propagators/). From c5b63f9ebddcd372d8cac6af13a77676d672eaed Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Thu, 20 Jun 2024 16:41:34 +0200 Subject: [PATCH 3/9] Apply suggestions from code review --- content/en/docs/languages/js/propagation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/en/docs/languages/js/propagation.md b/content/en/docs/languages/js/propagation.md index f4a7273ddd15..7c490108f596 100644 --- a/content/en/docs/languages/js/propagation.md +++ b/content/en/docs/languages/js/propagation.md @@ -2,6 +2,7 @@ title: Propagation description: Context propagation for the JS SDK weight: 65 +cSpell:ignore: rolldice --- {{% docs/languages/propagation js %}} From 1efb87392fa7e36f20e1c03927127dc0e4b4b765 Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Thu, 20 Jun 2024 19:57:45 +0200 Subject: [PATCH 4/9] Apply suggestions from code review Co-authored-by: Trent Mick --- content/en/docs/languages/js/propagation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/en/docs/languages/js/propagation.md b/content/en/docs/languages/js/propagation.md index 7c490108f596..c6c8047c179e 100644 --- a/content/en/docs/languages/js/propagation.md +++ b/content/en/docs/languages/js/propagation.md @@ -67,15 +67,15 @@ import { ConsoleSpanExporter, } from '@opentelemetry/sdk-trace-node'; import { UndiciInstrumentation } from '@opentelemetry/instrumentation-undici'; -import { request } from 'undici'; const sdk = new NodeSDK({ spanProcessors: [new SimpleSpanProcessor(new ConsoleSpanExporter())], instrumentations: [new UndiciInstrumentation()], }); - sdk.start(); +import { request } from 'undici'; + request('http://localhost:8080/rolldice').then((response) => { response.body.json().then((json: any) => console.log(json)); }); @@ -172,7 +172,7 @@ similar to the following: ``` Take note of the traceId (`cccd19c3a2d10e589f01bfe2dc896dc2`) and ID -(`6f64ce484217a7bf`). Both can be find in the output of client as well: +(`6f64ce484217a7bf`). Both can be found in the output of client as well: ```javascript {hl_lines=["6-7"]} { @@ -204,7 +204,7 @@ send both to a backend now the visualization will show this dependency for you. ## Manual context propagation In some cases, it is not possible to propagate context automatically as outlined -in previous section. There might not be an instrumentation library that matches +in the previous section. There might not be an instrumentation library that matches a library you're using to have services communicate with one another. Or you might have requirements that these libraries can't fulfill even if they existed. From fcbdb18d5e2215c3b6febaa5f4d1afdc88a07748 Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Fri, 21 Jun 2024 11:23:29 +0200 Subject: [PATCH 5/9] Apply suggestions from code review --- content/en/docs/languages/js/propagation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/languages/js/propagation.md b/content/en/docs/languages/js/propagation.md index c6c8047c179e..427825e36365 100644 --- a/content/en/docs/languages/js/propagation.md +++ b/content/en/docs/languages/js/propagation.md @@ -238,7 +238,7 @@ const output: Carrier = {}; // // This example uses the active trace context, but you can // use whatever context is appropriate to your scenario. -propagation.inject(trace.getTracerProvider().getActiveContext(), output); +propagation.inject(context.active(), output); // Extract the traceparent and tracestate values from the output object. const { traceparent, tracestate } = output; @@ -293,7 +293,7 @@ const input: Carrier = {}; // You can then treat this context as the active context for your // traces. let activeContext: Context = propagation.extract( - trace.getTracerProvider().getActiveContext(), + context.active(), input, ); From 2f77a626244f8bcd643267275989e6c4a2eedab3 Mon Sep 17 00:00:00 2001 From: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:02:46 +0000 Subject: [PATCH 6/9] Results from /fix:all --- content/en/docs/languages/js/propagation.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/content/en/docs/languages/js/propagation.md b/content/en/docs/languages/js/propagation.md index 427825e36365..093a3bef98fa 100644 --- a/content/en/docs/languages/js/propagation.md +++ b/content/en/docs/languages/js/propagation.md @@ -204,9 +204,10 @@ send both to a backend now the visualization will show this dependency for you. ## Manual context propagation In some cases, it is not possible to propagate context automatically as outlined -in the previous section. There might not be an instrumentation library that matches -a library you're using to have services communicate with one another. Or you -might have requirements that these libraries can't fulfill even if they existed. +in the previous section. There might not be an instrumentation library that +matches a library you're using to have services communicate with one another. Or +you might have requirements that these libraries can't fulfill even if they +existed. When you must propagate context manually, you can use the [context API](/docs/languages/js/context). @@ -292,10 +293,7 @@ const input: Carrier = {}; // // You can then treat this context as the active context for your // traces. -let activeContext: Context = propagation.extract( - context.active(), - input, -); +let activeContext: Context = propagation.extract(context.active(), input); let tracer = trace.getTracer('app-name'); From 0c1aa1d84153d6569841e796f079e665301c9988 Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Thu, 27 Jun 2024 12:40:22 +0200 Subject: [PATCH 7/9] Apply suggestions from code review Co-authored-by: Patrice Chalin --- content/en/docs/languages/js/propagation.md | 2 +- layouts/shortcodes/docs/languages/propagation.md | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/content/en/docs/languages/js/propagation.md b/content/en/docs/languages/js/propagation.md index 093a3bef98fa..c8a44bc162d3 100644 --- a/content/en/docs/languages/js/propagation.md +++ b/content/en/docs/languages/js/propagation.md @@ -9,7 +9,7 @@ cSpell:ignore: rolldice ## Automatic context propagations -[Instrumentation libraries](../libraries) like +[Instrumentation libraries](../libraries/) like [`@opentelemetry/instrumentation-http`](https://www.npmjs.com/package/@opentelemetry/instrumentation-http) or [`@opentelemetry/instrumentation-express`](https://www.npmjs.com/package/@opentelemetry/instrumentation-http) diff --git a/layouts/shortcodes/docs/languages/propagation.md b/layouts/shortcodes/docs/languages/propagation.md index a6b9d62e19db..15bd15837571 100644 --- a/layouts/shortcodes/docs/languages/propagation.md +++ b/layouts/shortcodes/docs/languages/propagation.md @@ -1,20 +1,19 @@ {{ $lang := .Get 0 | default "" -}} -With context propagation, [Signals](/docs/concepts/signals) can be correlated +With context propagation, [Signals](/docs/concepts/signals/) can be correlated with each other, regardless of where they are generated. Although not limited to -tracing, context propagation allows [traces](/docs/concepts/signals/traces) to +tracing, context propagation allows [traces](/docs/concepts/signals/traces/) to build causal information about a system across services that are arbitrarily distributed across process and network boundaries. For the vast majority of use cases, libraries that natively support -OpenTelemetry or [instrumentation libraries](../libraries) will automatically -propagate trace context across services for you. Only in rare cases you will +OpenTelemetry or [instrumentation libraries](../libraries/) will automatically +propagate trace context across services for you. It is only in rare cases that you will need to propagate context manually. {{ if $lang -}} -To learn more about context propagation, read the -[concept page about it](/docs/concepts/context-propagation). +To learn more, see [Context propagation](/docs/concepts/context-propagation). {{ else -}} From 06e8a90e39ccb12e5f1628b7d6a5fb6f3f7f0d67 Mon Sep 17 00:00:00 2001 From: Severin Neumann Date: Wed, 3 Jul 2024 21:25:51 +0200 Subject: [PATCH 8/9] Apply suggestions from code review Co-authored-by: Trent Mick --- content/en/docs/languages/js/propagation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/languages/js/propagation.md b/content/en/docs/languages/js/propagation.md index c8a44bc162d3..ac27c08351a3 100644 --- a/content/en/docs/languages/js/propagation.md +++ b/content/en/docs/languages/js/propagation.md @@ -38,7 +38,7 @@ npm install typescript \ @types/node \ undici \ @opentelemetry/instrumentation-undici \ - @opentelemetry/sdk-node \ + @opentelemetry/sdk-node # initialize typescript npx tsc --init @@ -50,7 +50,7 @@ npx tsc --init npm init -y npm install undici \ @opentelemetry/instrumentation-undici \ - @opentelemetry/sdk-node \ + @opentelemetry/sdk-node ``` {{% /tab %}} {{< /tabpane >}} From 9b46d7aa10e9f64f19bec6331c15ce928055d8ea Mon Sep 17 00:00:00 2001 From: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com> Date: Thu, 4 Jul 2024 07:37:30 +0000 Subject: [PATCH 9/9] Results from /fix:all --- layouts/shortcodes/docs/languages/propagation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/docs/languages/propagation.md b/layouts/shortcodes/docs/languages/propagation.md index 15bd15837571..d6a208af94b6 100644 --- a/layouts/shortcodes/docs/languages/propagation.md +++ b/layouts/shortcodes/docs/languages/propagation.md @@ -8,8 +8,8 @@ distributed across process and network boundaries. For the vast majority of use cases, libraries that natively support OpenTelemetry or [instrumentation libraries](../libraries/) will automatically -propagate trace context across services for you. It is only in rare cases that you will -need to propagate context manually. +propagate trace context across services for you. It is only in rare cases that +you will need to propagate context manually. {{ if $lang -}}