Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Layer for Context Propagation #62

Closed
jtescher opened this issue Jan 30, 2020 · 0 comments · Fixed by #101
Closed

Add Layer for Context Propagation #62

jtescher opened this issue Jan 30, 2020 · 0 comments · Fixed by #101
Assignees

Comments

@jtescher
Copy link
Member

See open-telemetry/oteps#66 for context

@jtescher jtescher self-assigned this Apr 12, 2020
jtescher added a commit that referenced this issue May 7, 2020
This adds an implementation of the [Correlations
API](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/correlationcontext/api.md)
which is used to annotate telemetry, adding context and information to
metrics, traces, and logs. It is an abstract data type represented by a
set of name/value pairs describing user-defined properties.

Example:

```rust
let propagator = CorrelationContextPropagator::new();
// can extract from any type that impls `Carrier`, usually an HTTP header map
let cx = propagator.extract(&headers);

// Iterate over extracted name / value pairs
for (name, value) in cx.correlation_context() {
  // ...
}

// Add new correlations
let cx_with_additions = cx.with_correlations(vec![Key::new("server_id").u64(42)]);

// Inject correlations into http request
propagator.inject_context(&cx_with_additions, &mut headers);
```

Resolves #62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant