docs(dotnet): Separate Prometheus exporter section into OTLP push and scrape/pull methods#8731
Merged
vitorvasc merged 23 commits intoopen-telemetry:mainfrom Feb 17, 2026
Merged
Conversation
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>
cijothomas
reviewed
Jan 2, 2026
cijothomas
approved these changes
Jan 2, 2026
Member
cijothomas
left a comment
There was a problem hiding this comment.
LGTM. thanks for improving this doc!
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
vitorvasc
reviewed
Jan 5, 2026
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
Contributor
Author
|
/fix:refcache @opentelemetrybot |
Contributor
|
✅ |
6 tasks
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>
Kielek
approved these changes
Jan 8, 2026
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(); |
Member
There was a problem hiding this comment.
It duplicates more or less OTLP section. I am not against repeating if you are fine with this.
Contributor
Author
There was a problem hiding this comment.
I think we should have this
cijothomas
approved these changes
Jan 11, 2026
Kielek
approved these changes
Jan 12, 2026
vitorvasc
reviewed
Jan 12, 2026
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
vitorvasc
approved these changes
Jan 12, 2026
Member
vitorvasc
left a comment
There was a problem hiding this comment.
LGTM!
/cc @cijothomas @Kielek - pinging you both just to check if there are any further comments; otherwise, we can merge it.
Thanks!
Member
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 |
Kielek
approved these changes
Feb 16, 2026
vitorvasc
reviewed
Feb 17, 2026
Signed-off-by: Pratik Mahalle <mahallepratik683@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8472.
contribution guidelines,
including the First-time contributing? note.
the
Generative AI Contribution Policy.
This PR reorganizes the Prometheus section in the .NET exporters documentation to clearly separate two distinct approaches for exporting metrics to Prometheus: