Skip to content

Conversation

@sei-jbooz
Copy link
Contributor

Adds support for open telemetry collection. Keycloak is used as an example. The aspire dashboard will now show keycloak otel traces, structured keycloak logs, and a subset of keycloak metrics. You can also optionally deploy prometheus for additional metrics collection.

  1. Adds an OpenTelemetryCollector service that deploys a new container via Aspire. Code for this taken from the Aspire example here: https://github.com/dotnet/aspire-samples/tree/main/samples/Metrics
  2. Direct apps to send Otel data to that collector, which forwards otel to the Aspire dashboard.
  3. Based on env vars, optionally deploy a prometheus resource which the otel collector will also forward metrics to.
  4. Configure Keycloak to send otel data to the otel collector. This includes setting Env Vars in Keycloak to configure sending trace data to the otel collecotr, enable metrics (only via a prometheus scrape and not via an otel send), and enable multiple log streams (standard console logs plus json-formatted file logs). The otel collector is configured to mount the keycloak log file to present structured logs in the aspire dashboard. This is required because keycloak does not send logs in an otel compliant format.

@sei-jbooz sei-jbooz requested a review from a team as a code owner October 28, 2025 16:02
@sei-jbooz sei-jbooz force-pushed the feature/opentelemetry branch from 4089f23 to 661bdaf Compare October 29, 2025 12:05
…llector.

The otel collector previously generated a lot of logs when prometheus wasn't deployed. This fixes that by having a config without the expectation of prometheus.
@sei-jbooz sei-jbooz closed this Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants