admin管理员组文章数量:1122846
I'm using OpenTelemetry for metrics instrumentation in a 8.0 console application.
services.AddOpenTelemetry()
.WithMetrics(builder =>
{
builder
.AddMeter("System.Net.Http")
.AddView(instrumentName: "http.client.open_connections", MetricStreamConfiguration.Drop)
.AddView(instrumentName: "http.client.connection.duration", MetricStreamConfiguration.Drop)
.AddView(instrumentName: "http.client.request.time_in_queue", MetricStreamConfiguration.Drop)
.AddView(instrumentName: "http.client.active_requests", MetricStreamConfiguration.Drop)
.AddView(instrumentName: "http.client.request.duration", new MetricStreamConfiguration
{
TagKeys = new string[] { "http.response.status_code", "server.port" },
})
.AddOtlpExporter((exporterOptions, metricReaderOptions) =>
{
exporterOptions.Endpoint = new Uri("http://localhost:4317");
});
});
I noticed that measurements for OTLP exporter requests are also collected (gRPC requests over port 4317).
As http.client.request.duration metric has a tag port
, can I filter out measurements by tag value?
I'm using .net OpenTelemetry for metrics instrumentation in a .net8.0 console application.
services.AddOpenTelemetry()
.WithMetrics(builder =>
{
builder
.AddMeter("System.Net.Http")
.AddView(instrumentName: "http.client.open_connections", MetricStreamConfiguration.Drop)
.AddView(instrumentName: "http.client.connection.duration", MetricStreamConfiguration.Drop)
.AddView(instrumentName: "http.client.request.time_in_queue", MetricStreamConfiguration.Drop)
.AddView(instrumentName: "http.client.active_requests", MetricStreamConfiguration.Drop)
.AddView(instrumentName: "http.client.request.duration", new MetricStreamConfiguration
{
TagKeys = new string[] { "http.response.status_code", "server.port" },
})
.AddOtlpExporter((exporterOptions, metricReaderOptions) =>
{
exporterOptions.Endpoint = new Uri("http://localhost:4317");
});
});
I noticed that measurements for OTLP exporter requests are also collected (gRPC requests over port 4317).
As http.client.request.duration metric has a tag port
, can I filter out measurements by tag value?
1 Answer
Reset to default 1There is no ability to filter metrics based on tags today in OpenTelemetry .NET.
本文标签: open telemetryFilter metrics by tag value using net OpenTelemetryStack Overflow
版权声明:本文标题:open telemetry - Filter metrics by tag value using .net OpenTelemetry - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736310072a1934246.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
AddMeter
, this only specifies that OpenTelemetry should read the already available metrics underSysten.Net.Http
and send them whenever a monitoring application asks for them on 4317 – Panagiotis Kanavos Commented Nov 21, 2024 at 14:22