You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
am trying to send a metric stream exported from my .NET Core application to the Prometheus remote write exporter. On the C# side metric is decorated with the custom label:
forecastRequestsCounter.Add(1, new KeyValuePair<string, object?>("request_tenant_id", appId));
I see this label in the metrics storage and can use it for filtering by labels in Grafana. Is it possible to extract the 'request_tenant_id' label when it enters the Otel collector pipeline and set it as a custom header for the Prometheus remotewrite exporter using some suitable processor? I tried headers_setter, but it does not seem right for this case.
The headers_setter in this case cannot access the metric labels, defined in my c# code.
The main motivation back this post is a need to set X-Scope-OrgID dynamically in a runtime,
Have found one discussion about that from the pasty year: open-telemetry/opentelemetry-go#5129
Not sure if this feature was/will be implemented..
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
am trying to send a metric stream exported from my .NET Core application to the Prometheus remote write exporter. On the C# side metric is decorated with the custom label:
forecastRequestsCounter.Add(1, new KeyValuePair<string, object?>("request_tenant_id", appId));
I see this label in the metrics storage and can use it for filtering by labels in Grafana. Is it possible to extract the 'request_tenant_id' label when it enters the Otel collector pipeline and set it as a custom header for the Prometheus remotewrite exporter using some suitable processor? I tried headers_setter, but it does not seem right for this case.
example of my collector config file:
extensions:
health_check: {}
headers_setter:
headers:
- action: insert
key: X-Scope-OrgID
from_context: tenant_id
prometheusremotewrite/metrics:
endpoint: .......
tls:
insecure: true
auth:
authenticator: headers_setter
resource_to_telemetry_conversion:
enabled: true
target_info:
enabled: false
service:
extensions:
- headers_setter
pipelines:
metrics:
receivers:
- otlp
exporters:
- prometheusremotewrite/metrics
The headers_setter in this case cannot access the metric labels, defined in my c# code.
The main motivation back this post is a need to set X-Scope-OrgID dynamically in a runtime,
Have found one discussion about that from the pasty year: open-telemetry/opentelemetry-go#5129
Not sure if this feature was/will be implemented..
Br
Beta Was this translation helpful? Give feedback.
All reactions