Prometheus fixes (#2433)
This commit is contained in:
parent
90d93fb637
commit
124c12afdf
|
|
@ -31,7 +31,7 @@ namespace Examples.Console
|
|||
/// dotnet run -p Examples.Console.csproj inmemory
|
||||
/// dotnet run -p Examples.Console.csproj zipkin -u http://localhost:9411/api/v2/spans
|
||||
/// dotnet run -p Examples.Console.csproj jaeger -h localhost -p 6831
|
||||
/// dotnet run -p Examples.Console.csproj prometheus -i 15 -p 9184 -d 2
|
||||
/// dotnet run -p Examples.Console.csproj prometheus -p 9184 -d 2
|
||||
/// dotnet run -p Examples.Console.csproj otlp -e "http://localhost:4317"
|
||||
/// dotnet run -p Examples.Console.csproj zpages
|
||||
/// dotnet run -p Examples.Console.csproj metrics --help
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace Examples.Console
|
|||
.AddPrometheusExporter(opt =>
|
||||
{
|
||||
opt.StartHttpListener = true;
|
||||
opt.HttpListenerPrefixes = new string[] { $"http://*:{port}/" };
|
||||
opt.HttpListenerPrefixes = new string[] { $"http://localhost:{port}/" };
|
||||
})
|
||||
.Build();
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,11 @@ namespace OpenTelemetry.Exporter.Prometheus
|
|||
path = $"/{path}";
|
||||
}
|
||||
|
||||
if (!path.EndsWith("/"))
|
||||
{
|
||||
path = $"{path}/";
|
||||
}
|
||||
|
||||
foreach (string prefix in exporter.Options.HttpListenerPrefixes)
|
||||
{
|
||||
this.httpListener.Prefixes.Add($"{prefix.TrimEnd('/')}{path}");
|
||||
|
|
|
|||
Loading…
Reference in New Issue