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

autoexport: OTLP exporter defaults to http/protobuf protocol instead of grpc #4100

Merged

Conversation

pellared
Copy link
Member

@pellared pellared commented Jul 26, 2023

Why

https://github.com/open-telemetry/opentelemetry-specification/blob/v1.23.0/specification/protocol/exporter.md?plain=1#L152-L155

If no configuration is provided the default transport SHOULD be http/protobuf
unless SDKs have good reasons to choose grpc as the default (e.g. for backward
compatibility reasons when grpc was already the default in a stable SDK
release).

Also a bugfix https://github.com/open-telemetry/opentelemetry-specification/blob/v1.23.0/specification/configuration/sdk-environment-variables.md?plain=1#L19

The SDK MUST interpret an empty value of an environment variable the same way as when the variable is unset.

What

OTLP exporter with http/protobuf protocol is created by default.

OTEL_EXPORTER_OTLP_PROTOCOL="" is handled the same way as if OTEL_EXPORTER_OTLP_PROTOCOL was unset.

Testing

Unfortunately there is no easy way to test what OTLP exporter is returned (grpc vs http). My only idea was to use reflect, but I am not sure if it is not an overkill.

I decided to add the tests anyway: 8a1cf4e

I created #4102 to improve the documentation.

@pellared pellared changed the title autoexport: OTEL_EXPORTER_OTLP_PROTOCOL defaults to http/protobuf autoexport: OTLP exporter defaults to http/protobuf protocol Jul 26, 2023
@pellared pellared changed the title autoexport: OTLP exporter defaults to http/protobuf protocol autoexport: OTLP exporter defaults to http/protobuf instead of grpc Jul 26, 2023
@pellared pellared changed the title autoexport: OTLP exporter defaults to http/protobuf instead of grpc autoexport: OTLP exporter defaults to http/protobuf protocol instead of grpc Jul 26, 2023
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #4100 (8a1cf4e) into main (33c3a8f) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #4100     +/-   ##
=======================================
+ Coverage   79.1%   79.3%   +0.1%     
=======================================
  Files        165     165             
  Lines      10318   10318             
=======================================
+ Hits        8170    8183     +13     
+ Misses      2010    2000     -10     
+ Partials     138     135      -3     
Files Changed Coverage Δ
exporters/autoexport/exporter.go 85.0% <100.0%> (+7.5%) ⬆️
exporters/autoexport/registry.go 100.0% <100.0%> (+17.5%) ⬆️

... and 2 files with indirect coverage changes

@pellared pellared marked this pull request as ready for review July 26, 2023 10:13
@pellared pellared requested a review from a team as a code owner July 26, 2023 10:13
@pellared

This comment was marked as outdated.

@pellared pellared requested a review from dashpole July 27, 2023 10:38
@pellared pellared merged commit b98e46d into open-telemetry:main Jul 27, 2023
22 checks passed
@pellared pellared deleted the autoexport-default-to-otlp-http branch July 27, 2023 14:30
@MrAlias MrAlias added this to the v0.43.0 milestone Aug 28, 2023
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 this pull request may close these issues.

None yet

4 participants