From 088921a203a1d32f22dfb66958a282a62857a68e Mon Sep 17 00:00:00 2001 From: Ruben Vargas Palma Date: Tue, 19 May 2020 14:13:21 -0500 Subject: [PATCH] =?UTF-8?q?docs:=20document=20CorrelationContext=20propaga?= =?UTF-8?q?tor=20under=20Built-in=20Implement=E2=80=A6=20(#1080)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/opentelemetry-core/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/opentelemetry-core/README.md b/packages/opentelemetry-core/README.md index 491c1041f8..8aa5f23148 100644 --- a/packages/opentelemetry-core/README.md +++ b/packages/opentelemetry-core/README.md @@ -13,6 +13,7 @@ This package provides default implementations of the OpenTelemetry API for trace * [HttpTraceContext Propagator](#httptracecontext-propagator) * [B3 Propagator](#b3-propagator) * [Composite Propagator](#composite-propagator) + * [Correlation Context Propagator](#correlation-context-propagator) - [Built-in Sampler](#built-in-sampler) * [Always Sampler](#always-sampler) * [Never Sampler](#never-sampler) @@ -55,6 +56,17 @@ const { CompositePropagator } = require("@opentelemetry/core"); api.propagation.setGlobalPropagator(new CompositePropagator()); ``` +#### Correlation Context Propagator +Provides a text-based approach to propagate [correlation context](https://w3c.github.io/correlation-context/) to remote services using the [OpenTelemetry CorrelationContext Propagation](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/correlationcontext/api.md#header-name) HTTP headers. + +```js +const api = require("@opentelemetry/api"); +const { HttpCorrelationContext } = require("@opentelemetry/core"); + +/* Set Global Propagator */ +api.propagation.setGlobalPropagator(new HttpCorrelationContext()); +``` + ### Built-in Sampler Sampler is used to make decisions on `Span` sampling.