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

otlpmetric: Support OTEL_EXPORTER_OTLP_PROTOCOL and OTEL_EXPORTER_OTLP_METRICS_PROTOCOL environmental variables #4641

Closed
pellared opened this issue Oct 16, 2023 · 4 comments
Assignees
Labels
area:metrics Part of OpenTelemetry Metrics enhancement New feature or request pkg:exporter:otlp Related to the OTLP exporter package

Comments

@pellared
Copy link
Member

Reference open-telemetry/opentelemetry-specification#3721 (comment)

@pellared pellared added enhancement New feature or request area:metrics Part of OpenTelemetry Metrics pkg:exporter:otlp Related to the OTLP exporter package labels Oct 16, 2023
@pellared pellared self-assigned this Oct 16, 2023
@pellared
Copy link
Member Author

pellared commented Oct 16, 2023

I think that it should really follow the database/sql driver pattern and require the users to call e.g. import _ "http://go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc" if one want to have support grpc for OTEL_EXPORTER_OTLP_PROTOCOL and OTEL_EXPORTER_OTLP_METRICS_PROTOCOL env vars.

I propose to add

  • the protocol client factory (driver) that is invoked when given protocol is told to be created
type Driver interface {
	New() Client
}
  • a registry function that is used to set a driver for OTEL_EXPORTER_OTLP_PROTOCOL and OTEL_EXPORTER_OTLP_METRICS_PROTOCOL env var value; this function would be used by init functions in otlptracehttp and otlptracegrpc
func RegisterProtocol(key string, driver Driver)
  • the New and NewUnstarted functions use the protocol drivers if a nil client is passed

The same pattern should be used for OTEL_METRICS_EXPORTER support. Users would have to call e.g. import _ "go.opentelemetry.io/otel/exporters/otlp/otlpmetric" if one want to have support otlp for OTEL_METRICS_EXPORTER env var.

The exported API should for traces and metrics should be similar.

@pellared
Copy link
Member Author

pellared commented Oct 16, 2023

In parallel, I plan to work on #4642, #4640, #2310 to have an API which would be consistent for all modules.

Probably I will start with a PoC draft PR to showcase the proposed API.

@pellared
Copy link
Member Author

@pellared pellared added the blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made label Oct 27, 2023
@pellared pellared assigned pellared and unassigned pellared Oct 27, 2023
@pellared
Copy link
Member Author

@pellared pellared closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
@pellared pellared removed the blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics enhancement New feature or request pkg:exporter:otlp Related to the OTLP exporter package
Projects
No open projects
Development

No branches or pull requests

1 participant