aspire
aspire copied to clipboard
Add support for http OTLP endpoint in the dashboard
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.
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.
@davidfowl / @JamesNK this is for post GA correct?
Correct. This can stay in the backlog
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
+1 for this feature
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:
https://opentelemetry.io/docs/languages/js/exporters/#usage-in-the-browser
Keeping this in the backlog because it's needed for non-Aspire services.
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 :)
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
@sharpSteff sent a PR!
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 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.