aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Add support for http OTLP endpoint in the dashboard

Open davidfowl opened this issue 10 months ago • 10 comments

Right now the dashboard supports the grpc OTLP endpoint, we could support http as well but it's unclear how much demand or need there is for it. Filing this issue so others can upvote.

davidfowl avatar Apr 15 '24 01:04 davidfowl

Work involved:

  • Add new endpoint for OTLP http. See https://opentelemetry.io/docs/specs/otlp/#otlphttp-default-port. HTTP protocol will be Http1AndHttp2 (default's to HTTP/1.1 when there isn't TLS).
  • Protobuf over HTTP. Existing Protobuf data over HTTP instead of gRPC. https://opentelemetry.io/docs/specs/otlp/#binary-protobuf-encoding
  • JSON over HTTP. New JSON DTOs plus mapping data. Unfortunatly OTLP uses custom Protobuf/JSON mapping rules and gRPC JSON transcoding probably can't be used. https://opentelemetry.io/docs/specs/otlp/#json-protobuf-encoding
  • A way to select what protocol you want a resource to use in app model. i.e. there is a container that only supports OTLP over HTTP. API specifies OTEL env vars for the HTTP endpoint and protocol should be used to launch it.

JamesNK avatar Apr 15 '24 01:04 JamesNK

@davidfowl / @JamesNK this is for post GA correct?

kvenkatrajan avatar Apr 15 '24 18:04 kvenkatrajan

Correct. This can stay in the backlog

davidfowl avatar Apr 15 '24 18:04 davidfowl

Related: Documentation to make it clear only OTLP/grpc is supported:

  • https://github.com/dotnet/docs-aspire/pull/678
  • https://github.com/dotnet/aspire-samples/pull/195

JamesNK avatar Apr 16 '24 00:04 JamesNK

+1 for this feature

thangchung avatar Apr 18 '24 18:04 thangchung

Support for http is required in case you want to use OTLP from the browser. Currently the OTLP SDK doesn't support gRPC from the browser:

image

https://opentelemetry.io/docs/languages/js/exporters/#usage-in-the-browser

ThomasPiskol avatar Apr 26 '24 09:04 ThomasPiskol

Keeping this in the backlog because it's needed for non-Aspire services.

leslierichardson95 avatar May 02 '24 20:05 leslierichardson95

Nor AzureMonitorTraceExporter or OTLPTraceExporter works in the browser, so its a bit of sad face when using some hours getting into otel and finally getting things up and running, then to realize there is no real path atm to export from browser frontend :D Would be cool to have this implementet so we can use http protocol, or alternative fix those exports to use grpc :)

pksorensen avatar May 08 '24 10:05 pksorensen

For those wanting this, especially those looking at it from a Browser perspective. In production, you'll be using the collector as an entrypoint for browser based telemetry from a security perspective etc.

I built a library that should allow you to do this right now by adding an Otel Collector to aspire.

https://www.nuget.org/packages/PracticalOtel.OtelCollector.Aspire/0.9.3-rc

martinjt avatar May 10 '24 11:05 martinjt

@sharpSteff sent a PR!

davidfowl avatar May 18 '24 06:05 davidfowl

Merged! https://github.com/dotnet/aspire/pull/4197

The dashboard supports OTLP/HTTP with Protobuf as the payload. It currently doesn't support JSON payloads, which is more difficult.

I'm going to close this as done. If there is feedback that JSON support is important then we can revisit it.

JamesNK avatar Jun 21 '24 01:06 JamesNK

@JamesNK can you file the JSON issue with as much detail as possible. Contributors can take it on if it’s clear what need a to happen.

davidfowl avatar Jun 21 '24 02:06 davidfowl