Adding support for setting OTLP exporter protocol by env vars#2893
Adding support for setting OTLP exporter protocol by env vars#2893srikanthccv merged 10 commits intoopen-telemetry:mainfrom
Conversation
|
|
opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py
Outdated
Show resolved
Hide resolved
galbash
left a comment
There was a problem hiding this comment.
in the PR you mentioned:
Since the SDK already supports setting the protocol using the values otlp_proto_grpc and otlp_proto_http of OTEL_TRACES_EXPORTER, these values are still supported and have priority over the new supported variables. In case of conflict, a warning will be printed.
Is our goal to deprecate otlp_proto_grpc/http over time or discourage the use of them? if so maybe we should issue a deprecation warning / log
opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py
Outdated
Show resolved
Hide resolved
@srikanthccv what do you think about that? |
|
Ideally we should deprecate them. It may be our shortsightedness because the way this going - for someone who is Installing just the |
|
I think it's OK that the user will have to explicitly specify the OTLP protocol in case he doesn't use the default value. |
Description
Fixes #2586
Adding support for specifying OTLP export protocol using env vars, as defined in the specifications.
Since the SDK already supports setting the protocol using the values
otlp_proto_grpcandotlp_proto_httpofOTEL_TRACES_EXPORTER, these values are still supported and have priority over the new supported variables. In case of conflict, a warning will be printed.Future support for configuring metrics and logs with HTTP exporter is already added, although those do not exist yet, therefore will result in a
RuntimeError.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Does This PR Require a Contrib Repo Change?
See open-telemetry/opentelemetry-python-contrib#1250
Contrib repo change is not necessarily required, but it is related to fixing the same issue.
Checklist: