1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-07-03 00:27:03 +02:00

Reorganize propagation code (shrink PR 381) (#444)

* Rename distributedcontext package to correlation

Correlation is the name we agreed upon.

* Move trace propagators to api/trace

The trace propagators tests had to be moved to a testtrace subpackage
to avoid import cycles between api/trace and internal/trace.

Needed to shut up golint about stutter in trace.TraceContext -
TraceContext is a name of a W3C spec, so this stutter is
expected. It's certainly still better than golint's suggestion of
having trace.Context.

* Rename api/propagators to api/propagation

This package will not contain any propagators in the long run, just
the interface definitions.

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
This commit is contained in:
Krzesimir Nowak
2020-01-28 19:13:46 +01:00
committed by Rahul Patel
parent 437d9af9ab
commit 6b4acf47b8
30 changed files with 271 additions and 312 deletions

View File

@ -18,7 +18,7 @@ import (
"context"
"log"
"go.opentelemetry.io/otel/api/distributedcontext"
"go.opentelemetry.io/otel/api/correlation"
"go.opentelemetry.io/otel/api/global"
"go.opentelemetry.io/otel/api/key"
"go.opentelemetry.io/otel/api/metric"
@ -82,7 +82,7 @@ func main() {
ctx := context.Background()
ctx = distributedcontext.NewContext(ctx,
ctx = correlation.NewContext(ctx,
fooKey.String("foo1"),
barKey.String("bar1"),
)
@ -105,7 +105,7 @@ func main() {
meter.RecordBatch(
// Note: call-site variables added as context Entries:
distributedcontext.NewContext(ctx, anotherKey.String("xyz")),
correlation.NewContext(ctx, anotherKey.String("xyz")),
commonLabels,
oneMetric.Measurement(1.0),