Skip to content

Commit

Permalink
Add baggage implementation based on the W3C and OpenTelemetry specifi…
Browse files Browse the repository at this point in the history
…cation (#1967)

* Rename baggage context file

* Initial baggage implementation

* Initial tests

* More tests

* Update baggage context functionality

* Add New method to baggage pkg

* Update namedtracer example

* URL encode baggage values

* Refactor and use internal baggage pkg

* Update OpenTracing bridge

* Update baggage propagator

* Fix lint and test errors

* Add changes to changelog

* Apply suggestions from code review

* Rename testcase field per suggestion

* Update test to verify last-one-wins semantics

* Explicitly seed random numbers with static seed in tests

* Parse Member key/value with string split

* Add test for member parse with equal signs in value

* Trim whitespaces for member key/value
  • Loading branch information
MrAlias committed Jun 8, 2021
1 parent bbe2b8a commit 4bf6150
Show file tree
Hide file tree
Showing 15 changed files with 1,657 additions and 930 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -33,6 +33,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
This method returns the number of list-members the `TraceState` holds. (#1937)
- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace` that defines a trace exporter that uses a `otlptrace.Client` to send data.
Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` implementing a gRPC `otlptrace.Client` and offers convenience functions, `NewExportPipeline` and `InstallNewPipeline`, to setup and install a `otlptrace.Exporter` in tracing .(#1922)
- The `Baggage`, `Member`, and `Property` types are added to the `go.opentelemetry.io/otel/baggage` package along with their related functions. (#1967)
- The new `ContextWithBaggage`, `ContextWithoutBaggage`, and `FromContext` functions were added to the `go.opentelemetry.io/otel/baggage` package.
These functions replace the `Set`, `Value`, `ContextWithValue`, `ContextWithoutValue`, and `ContextWithEmpty` functions from that package and directly work with the new `Baggage` type. (#1967)
- The `OTEL_SERVICE_NAME` environment variable is the preferred source for `service.name`, used by the environment resource detector if a service name is present both there and in `OTEL_RESOURCE_ATTRIBUTES`. (#1969)
- Creates package `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` implementing a HTTP `otlptrace.Client` and offers convenience functions, `NewExportPipeline` and `InstallNewPipeline`, to setup and install a `otlptrace.Exporter` in tracing. (#1963)

Expand Down Expand Up @@ -89,6 +92,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
The `"go.opentelemetry.io/otel".Tracer` function or a `TracerProvider` should be used to acquire a library specific `Tracer` instead. (#1900)
- The `http.url` attribute generated by `HTTPClientAttributesFromHTTPRequest` will no longer include username or password information. (#1919)
- The `IsEmpty` method of the `TraceState` type in the `go.opentelemetry.io/otel/trace` package is removed in favor of using the added `TraceState.Len` method. (#1931)
- The `Set`, `Value`, `ContextWithValue`, `ContextWithoutValue`, and `ContextWithEmpty` functions in the `go.opentelemetry.io/otel/baggage` package are removed.
Handling of baggage is now done using the added `Baggage` type and related context functions (`ContextWithBaggage`, `ContextWithoutBaggage`, and `FromContext`) in that package. (TBD)

### Fixed

Expand Down

0 comments on commit 4bf6150

Please sign in to comment.