Skip to content

docs(dotnet): Separate Prometheus exporter section into OTLP push and scrape/pull methods#8731

Merged
vitorvasc merged 23 commits intoopen-telemetry:mainfrom
pratik-mahalle:otel
Feb 17, 2026
Merged

docs(dotnet): Separate Prometheus exporter section into OTLP push and scrape/pull methods#8731
vitorvasc merged 23 commits intoopen-telemetry:mainfrom
pratik-mahalle:otel

Conversation

@pratik-mahalle
Copy link
Copy Markdown
Contributor

@pratik-mahalle pratik-mahalle commented Jan 2, 2026

Closes #8472.

This PR reorganizes the Prometheus section in the .NET exporters documentation to clearly separate two distinct approaches for exporting metrics to Prometheus:

  1. Using OTLP Exporter (Push) - Push metrics to Prometheus using the OTLP protocol
  2. Using Prometheus Exporter (Pull/Scrape) - Expose a scraping endpoint for Prometheus to pull metrics

Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
@pratik-mahalle pratik-mahalle requested a review from a team as a code owner January 2, 2026 13:57
@pratik-mahalle pratik-mahalle changed the title separate the section in the expoters docs(dotnet): Separate Prometheus exporter section into OTLP push and scrape/pull methods Jan 2, 2026
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
Comment thread content/en/docs/languages/dotnet/exporters.md Outdated
Copy link
Copy Markdown
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. thanks for improving this doc!

pratik-mahalle and others added 2 commits January 3, 2026 08:39
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
Comment thread content/en/docs/languages/dotnet/exporters.md
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
@pratik-mahalle
Copy link
Copy Markdown
Contributor Author

/fix:refcache @opentelemetrybot

@otelbot-docs
Copy link
Copy Markdown
Contributor

otelbot-docs Bot commented Jan 5, 2026

fix:refcache applied successfully in run 20711921273.

pratik-mahalle and others added 7 commits January 8, 2026 07:35
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
Comment on lines +247 to +272
```csharp
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddOpenTelemetry()
.WithMetrics(metrics => metrics
// The rest of your setup code goes here
.AddOtlpExporter(options =>
{
options.Endpoint = new Uri("http://localhost:9090/api/v1/otlp/v1/metrics");
options.Protocol = OtlpExportProtocol.HttpProtobuf;
}));
```

##### Non-ASP.NET Core {#prometheus-otlp-non-asp-net-core-usage}

Configure the exporter when creating a `MeterProvider`:

```csharp
var meterProvider = Sdk.CreateMeterProviderBuilder()
// Other setup code, like setting a resource goes here too
.AddOtlpExporter(options =>
{
options.Endpoint = new Uri("http://localhost:9090/api/v1/otlp/v1/metrics");
options.Protocol = OtlpExportProtocol.HttpProtobuf;
})
.Build();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It duplicates more or less OTLP section. I am not against repeating if you are fine with this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have this

@otelbot-docs otelbot-docs Bot requested a review from a team January 8, 2026 16:28
@otelbot-docs otelbot-docs Bot requested review from a team January 12, 2026 06:30
Comment thread content/en/docs/languages/dotnet/exporters.md
Copy link
Copy Markdown
Member

@vitorvasc vitorvasc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

/cc @cijothomas @Kielek - pinging you both just to check if there are any further comments; otherwise, we can merge it.

Thanks!

@Kielek
Copy link
Copy Markdown
Member

Kielek commented Jan 13, 2026

@vitorvasc - #8731 (comment)

@pratik-mahalle
Copy link
Copy Markdown
Contributor Author

Hey @Kielek, can you please review the comment #8731 (comment) and give us a feedback. If everything is good, then I think we are good to go

@otelbot-docs otelbot-docs Bot requested review from a team February 17, 2026 09:38
Comment thread content/en/docs/languages/dotnet/exporters.md Outdated
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
@vitorvasc vitorvasc added this pull request to the merge queue Feb 17, 2026
Merged via the queue into open-telemetry:main with commit c89997d Feb 17, 2026
22 checks passed
@pratik-mahalle pratik-mahalle deleted the otel branch February 17, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

OTel .NET - Prometheus exporter section needs some rewrite

4 participants