weaveworks-experiments / kspan

Turning Kubernetes Events into spans
Apache License 2.0
785 stars 56 forks source link

Add support for OTLP secured and headers #9

Closed puckpuck closed 3 years ago

puckpuck commented 3 years ago

This PR adds support to specify secured communication and adding headers to the OTLP exporter. This is done via the command line otlp-secured and otlp-headers flag.

The default is insecured communication with no headers.

To use secure communication add the command line flag --otlp-secured

To specify headers, specify them as key/value pairs separated by commas --oltp-headers=x-header-1=value1,x-header-2=value2

To accomplish this, updating to OpenTelemetry Go SDK 0.19.0 was required, which was a much larger undertaking due to the various internal API changes. A notable change is the name label/attribute added to spans conflicts with the Span's Name field. As such, the attribute was renamed to object.