Repository: lightstep/otel-launcher-go
Pull request #49 (2021-03-02 23:07:45)

add ot propagator support
Adding configuration support for `ot` propagator

codecov-io: # [Codecov](https://codecov.io/gh/lightstep/otel-launcher-go/pull/49?src=pr&el=h1) Report
> Merging [#49](https://codecov.io/gh/lightstep/otel-launcher-go/pull/49?src=pr&el=desc) (c12a85f) into [main](https://codecov.io/gh/lightstep/otel-launcher-go/commit/6929c308c2c79acbb98c2a68d6eab56b4c009cd0?el=desc) (6929c30) will **increase** coverage by `0.02%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/lightstep/otel-launcher-go/pull/49/graphs/tree.svg?width=650&height=150&src=pr&token=bKAtQGZKIp)](https://codecov.io/gh/lightstep/otel-launcher-go/pull/49?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##             main      #49      +/-   ##
==========================================
+ Coverage   92.11%   92.14%   +0.02%     
==========================================
  Files           3        3              
  Lines         279      280       +1     
==========================================
+ Hits          257      258       +1     
  Misses         11       11              
  Partials       11       11              
```


| [Impacted Files](https://codecov.io/gh/lightstep/otel-launcher-go/pull/49?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [launcher/config.go](https://codecov.io/gh/lightstep/otel-launcher-go/pull/49/diff?src=pr&el=tree#diff-bGF1bmNoZXIvY29uZmlnLmdv) | `89.89% <100.00%> (+0.05%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/lightstep/otel-launcher-go/pull/49?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/lightstep/otel-launcher-go/pull/49?src=pr&el=footer). Last update [6929c30...c12a85f](https://codecov.io/gh/lightstep/otel-launcher-go/pull/49?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ca929a3..b4d1143 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
 ### Changed
 - Update OpenTelemetry dependencies to 0.18.0
 - Update OpenTelemetry dependencies to 0.17.0
+- Add support for `ottrace` propagator
 
 ## 0.16.1
 - Enable gzip compression by default
diff --git a/launcher/config.go b/launcher/config.go
index 59eae7b..6eb97fc 100644
--- a/launcher/config.go
+++ b/launcher/config.go
@@ -28,6 +28,7 @@ import (
 	hostMetrics "go.opentelemetry.io/contrib/instrumentation/host"
 	runtimeMetrics "go.opentelemetry.io/contrib/instrumentation/runtime"
 	"go.opentelemetry.io/contrib/propagators/b3"
+	"go.opentelemetry.io/contrib/propagators/ot"
 	"go.opentelemetry.io/otel"
 	"go.opentelemetry.io/otel/attribute"
 	"go.opentelemetry.io/otel/exporters/otlp"
@@ -271,6 +272,7 @@ func configurePropagators(c *Config) error {
 		"b3":           b3.B3{},
 		"baggage":      propagation.Baggage{},
 		"tracecontext": propagation.TraceContext{},
+		"ottrace":      ot.OT{},
 	}
 	var props []propagation.TextMapPropagator
 	for _, key := range c.Propagators {
@@ -280,7 +282,7 @@ func configurePropagators(c *Config) error {
 		}
 	}
 	if len(props) == 0 {
-		return fmt.Errorf("invalid configuration: unsupported propagators. Supported options: b3,cc")
+		return fmt.Errorf("invalid configuration: unsupported propagators. Supported options: b3,baggage,tracecontext,ottrace")
 	}
 	otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(
 		props...,


Test patch:
diff --git a/launcher/config_test.go b/launcher/config_test.go
index bdbdcce..4831551 100644
--- a/launcher/config_test.go
+++ b/launcher/config_test.go
@@ -473,7 +473,7 @@ func TestConfigurePropagators(t *testing.T) {
 	)
 	defer lsOtel.Shutdown()
 
-	expected := "invalid configuration: unsupported propagators. Supported options: b3,cc"
+	expected := "invalid configuration: unsupported propagators. Supported options: b3,baggage,tracecontext,ottrace"
 	if !strings.Contains(logger.output[0], expected) {
 		t.Errorf("\nString not found: %v\nIn: %v", expected, logger.output[0])
 	}