Modify example asp.net core app to config prometheus options (#2988)

This commit is contained in:
Cijo Thomas 2022-03-10 10:52:25 -08:00 committed by GitHub
parent 0a84e11272
commit 97f21802a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -147,6 +147,8 @@ namespace Examples.AspNetCore
break;
}
});
services.Configure<PrometheusExporterOptions>(this.Configuration.GetSection("Prometheus"));
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

View File

@ -17,6 +17,9 @@
"Endpoint": "http://localhost:14268",
"Protocol": "UdpCompactThrift"
},
"Prometheus": {
"ScrapeResponseCacheDurationMilliseconds": 5000
},
"Zipkin": {
"ServiceName": "zipkin-test",
"Endpoint": "http://localhost:9411/api/v2/spans"

View File

@ -66,7 +66,7 @@ namespace OpenTelemetry.Exporter.Prometheus
}
/// <summary>
/// Start exporter.
/// Start Http Server.
/// </summary>
/// <param name="token">An optional <see cref="CancellationToken"/> that can be used to stop the HTTP server.</param>
public void Start(CancellationToken token = default)