open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
716 stars 178 forks source link

Default to OTEL_EXPORTER_OTLP_PROTOCOL=grpc if ext-grpc and open-telemetry/transport-grpc available #1305

Closed dkarlovi closed 4 months ago

dkarlovi commented 4 months ago

OTEL_EXPORTER_OTLP_PROTOCOL is said to have:

Default value: SDK-dependent

Is your feature request related to a problem?

Assuming both ext-grpc and open-telemetry/transport-grpc are installed, this shows intent to use gRPC.

One env var less to configure.

Describe the solution you'd like

The protocol could easily default to grpc in that case.

Describe alternatives you've considered

Stay as is.

ChrisLightfootWild commented 4 months ago

The specification suggests that this should default to http/protobuf. Furthermore:

[1]: SDKs SHOULD default endpoint variables to use http scheme unless they have good reasons to choose https scheme for the default (e.g., for backward compatibility reasons in a stable SDK release).

So is this deemed a good enough reason to deviate? :thinking:

--

Regarding the configuration of compression, I did note that:

[3]: If no compression value is explicitly specified, SIGs can default to the value they deem most useful among the supported options.

Whereas this was not explicitly suggested in relation to the protocol.

dkarlovi commented 4 months ago

Ah, I didn't see that, for reference you mean

If no configuration is provided the default transport SHOULD be http/protobuf unless SDKs have good reasons to choose grpc as the default

In which case I agree it shouldn't deviate indeed. :+1: Closing.