Nextended.Aspire.Hosting.Grafana 10.1.19

dotnet add package Nextended.Aspire.Hosting.Grafana --version 10.1.19
                    
NuGet\Install-Package Nextended.Aspire.Hosting.Grafana -Version 10.1.19
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nextended.Aspire.Hosting.Grafana" Version="10.1.19" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nextended.Aspire.Hosting.Grafana" Version="10.1.19" />
                    
Directory.Packages.props
<PackageReference Include="Nextended.Aspire.Hosting.Grafana" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nextended.Aspire.Hosting.Grafana --version 10.1.19
                    
#r "nuget: Nextended.Aspire.Hosting.Grafana, 10.1.19"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nextended.Aspire.Hosting.Grafana@10.1.19
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nextended.Aspire.Hosting.Grafana&version=10.1.19
                    
Install as a Cake Addin
#tool nuget:?package=Nextended.Aspire.Hosting.Grafana&version=10.1.19
                    
Install as a Cake Tool

Nextended.Aspire.Hosting.Grafana

Grafana observability stack for .NET Aspire — Grafana, Prometheus, Loki, Tempo, Promtail, cAdvisor, postgres_exporter and OpenTelemetry Collector as composable container resources. Datasources are auto-provisioned, all YAML configs are generated at application start from the actual resource names — no hardcoded config files, and the fluent calls work in any order.

Fluent API

var builder = DistributedApplication.CreateBuilder(args);

var pg = builder.AddPostgres("pg");

builder.AddGrafana("grafana")
    .WithAnonymousAdmin()                    // or .WithAdminUser("admin", password)
    .WithPrometheus(configure: p => p
        .WithRetention("30d")
        .WithScrapeTarget("api", "my-api:8080")
        .WithDataVolume())
    .WithLoki(configure: l => l.WithPromtail())  // Promtail ships all Docker container logs
    .WithTempo()
    .WithOtelCollector()                     // OTLP receiver, fans out to Tempo/Loki/Prometheus
    .WithCAdvisor()                          // per-container CPU/Memory/Network metrics
    .WithPostgresDatasource(pg)              // browse your DB from Grafana
    .WithPostgresExporter(pg)                // DB internals as Prometheus metrics
    .WithDashboards("./dashboards", "MyApp") // auto-loaded dashboard JSONs
    .WithDataVolume();                       // Grafana state survives container recreation

builder.Build().Run();

Every component call also provisions the matching Grafana datasource, wires start ordering (WaitFor) and nests the container under Grafana in the Aspire dashboard. Anything the typed methods don't cover goes through the escape hatch:

grafana.WithDatasource(new GrafanaDatasource
{
    Name = "MySQL",
    Type = "mysql",
    Url = "my-mysql:3306",
    User = "app",
});

One-call stack

using Nextended.Aspire.Hosting.Observability;

builder.AddObservabilityStack(new ObservabilityStackOptions
{
    ConfigRootPath = Path.Combine(builder.AppHostDirectory, "observability"),
    IncludeTempo = true,
    IncludeOtelCollector = true,
    GrafanaDashboardsFolder = "MyApp",
});

Nextended.Aspire.Hosting.Supabase builds on this package and adds an overload that derives the Postgres connection from a Supabase stack: builder.AddObservabilityStack(supabase, opts => …).

Notes

  • Promtail and cAdvisor need the host's Docker socket — they are automatically skipped in publish mode (azd up).
  • Generated configs land under {configRoot}/.generated/ so you can inspect what the containers actually loaded.
  • Secrets (datasource passwords) flow through container env vars; the generated YAML only contains ${VAR} references.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Nextended.Aspire.Hosting.Grafana:

Package Downloads
Nextended.Aspire.Hosting.Supabase

This Library provides an Aspire Supabase solution

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.1.19 34 7/23/2026
10.1.18 200 7/22/2026
10.1.17 117 7/21/2026
10.1.16 83 7/21/2026
10.1.15 82 7/21/2026