Skip to content

Add CommunityToolkit.Aspire.Hosting.Grafana.OtelLgtm, a new hosting#1159

Draft
paulomorgado wants to merge 2 commits intoCommunityToolkit:mainfrom
paulomorgado:feature/grafana-otel-lgtm
Draft

Add CommunityToolkit.Aspire.Hosting.Grafana.OtelLgtm, a new hosting#1159
paulomorgado wants to merge 2 commits intoCommunityToolkit:mainfrom
paulomorgado:feature/grafana-otel-lgtm

Conversation

@paulomorgado
Copy link
Contributor

integration for the grafana/otel-lgtm Docker image which bundles the OpenTelemetry Collector, Prometheus, Loki, Tempo, Pyroscope, and Grafana into a single container for dev/test observability.

Features:

  • AddGrafanaOtelLgtm() with Grafana UI (3000), OTLP gRPC (4317), and OTLP HTTP (4318) endpoints
  • WithConfig() to mount custom OTel Collector configuration
  • WithAppForwarding() to route all app telemetry through the stack
  • WithGrafanaOtelLgtmRouting() for per-resource telemetry routing
  • WithDataVolume() for data persistence across restarts
  • WithEnvironmentVariable() for container configuration
  • Health check on Grafana /api/health endpoint

Includes:

  • Source project with resource, extensions, and README
  • Example AppHost with Api, ServiceDefaults, and collector config
  • Unit and integration tests mirroring OpenTelemetryCollector patterns

Closes #1158

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

integration for the grafana/otel-lgtm Docker image which bundles the
OpenTelemetry Collector, Prometheus, Loki, Tempo, Pyroscope, and
Grafana into a single container for dev/test observability.

Features:
- AddGrafanaOtelLgtm() with Grafana UI (3000), OTLP gRPC (4317),
  and OTLP HTTP (4318) endpoints
- WithConfig() to mount custom OTel Collector configuration
- WithAppForwarding() to route all app telemetry through the stack
- WithGrafanaOtelLgtmRouting() for per-resource telemetry routing
- WithDataVolume() for data persistence across restarts
- WithEnvironmentVariable() for container configuration
- Health check on Grafana /api/health endpoint

Includes:
- Source project with resource, extensions, and README
- Example AppHost with Api, ServiceDefaults, and collector config
- Unit and integration tests mirroring OpenTelemetryCollector patterns
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1159

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1159"

…a OTel-LGTM

- Add GrafanaOtelLgtmSettings with configureSettings action matching
  OpenTelemetryCollector pattern (image, tag, enable/disable endpoints,
  ForceNonSecureReceiver)
- Add HTTPS certificate configuration for OTLP receivers when Aspire
  dashboard uses HTTPS
- Add Prometheus (port 9090) and Pyroscope (port 4040) HTTP endpoints
- Remove WithEnvironmentVariable (thin wrapper over built-in WithEnvironment)
- Remove isProxied: false from OTLP endpoints to match OTel Collector
- Rename WithConfig to WithCollectorConfig for clarity
- Add tests for settings, endpoint toggling, and new endpoints (25 total)
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.

Consider adding an integration for grafana/otel-lgtm

1 participant