opentelemetry-specification icon indicating copy to clipboard operation
opentelemetry-specification copied to clipboard

Clarification around "OpenTelemetry instrumentation libraries default export"

Open svrnm opened this issue 2 years ago • 4 comments

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:

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?

svrnm avatar May 03 '22 18:05 svrnm

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]

Aneurysm9 avatar May 09 '22 22:05 Aneurysm9

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.

cijothomas avatar May 11 '22 17:05 cijothomas

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 and OTEL_LOGS_EXPORTER can not be set to otlp by default.

svrnm avatar Aug 29 '22 10:08 svrnm

Just to add, in .NET you also need an extra package for the OTLP exporter: https://www.nuget.org/packages/OpenTelemetry.Exporter.OpenTelemetryProtocol

joaopgrassi avatar Aug 29 '22 14:08 joaopgrassi

we fixed this issue in the docs already a while back, so this issue is complete

svrnm avatar Jan 17 '24 20:01 svrnm