opentelemetry-specification
opentelemetry-specification copied to clipboard
Clarification around "OpenTelemetry instrumentation libraries default export"
The OpenTelemetry documentation has the following statement at Collector Getting Started:
OpenTelemetry instrumentation libraries by default export their data assuming a locally running Collector is available.
Based on this quick exchange on slack it looks like that this behaviour is not specified explicitly:
- SDK Environment variables define OTLP as default for OTEL_*_EXPORTERS
- OTLP exporter spec defines localhost & port 4318 as default
My questions are
- is this statement in the docs correct?
- would it be worthwile to make this requirement explicit in the spec?
- are all instrumentation libraries following this?
The OTLP exporter spec defines http://localhost:4318
as the default endpoint for HTTP, but http://localhost:4317
as the default endpoint for gRPC. It later defines http/protobuf
as the default protocol.
Protocol: The transport protocol. Options MUST be one of: grpc, http/protobuf, http/json. See Specify Protocol for more details.
Default: http/protobuf [3]
OpenTelemetry instrumentation libraries by default export their data
Instrumentation Libraries provide instrumentation. It has no control on where the telemetry is exported. So I think the statement "OpenTelemetry instrumentation libraries by default export their data" is incorrect.
getting back to this again, since I think I start to understand that issue a little bit better. The sentence mentioned above has now moved to a different page (https://opentelemetry.io/docs/collector/deployment/), but still exists:
OpenTelemetry instrumentation libraries by default export their data assuming a locally running Collector is available.
from @cijothomas I understand that "instrumentation libraries" is of course incorrect here, this should be SDK, right?
OpenTelemetry SDKs by default export their data assuming a locally running Collector is available.
Now, from what I see right now across the language SDKs this is not the case: they require the installation of an additional package to enable OTLP export (go, nodejs, python, ruby)
So my question boils down to:
Does the spec require SDKs to have an OTLP exporter by default and use it to send their data to a locally running collector?
Here's how I understand the implications of these questions:
- If the answer to this question is yes, the the language-specific SDKs need to have the otlp exporter bundled out of the box.
- If the answer to this question is no the spec on SDK Environment Variables needs to be updated, because the default for
OTEL_TRACES_EXPORTER
,OTEL_METRICS_EXPORTER
andOTEL_LOGS_EXPORTER
can not be set to otlp by default.
Just to add, in .NET you also need an extra package for the OTLP exporter: https://www.nuget.org/packages/OpenTelemetry.Exporter.OpenTelemetryProtocol
we fixed this issue in the docs already a while back, so this issue is complete