-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[exporter/loadbalancing] allow metrics routing #26378
[exporter/loadbalancing] allow metrics routing #26378
Conversation
In this second iteration I've tought about it and decide that for metrics, if routing key is empty or set to traceId, metrics exporter will consider service's. |
If it's set to traceID, it should return an error: the user has explicitly stated something that cannot be honored. We also have a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that it took so long, but this LGTM. I did some basic manual testing as well, as follows:
Config used:
receivers:
otlp/loadbalancer:
protocols:
grpc:
http:
otlp/backend-1:
protocols:
grpc:
endpoint: localhost:5317
otlp/backend-2:
protocols:
grpc:
endpoint: localhost:6317
otlp/backend-3:
protocols:
grpc:
endpoint: localhost:7317
processors:
exporters:
logging/loadbalancer:
logging/backend-1:
logging/backend-2:
logging/backend-3:
loadbalancing:
routing_key: "service"
protocol:
otlp:
tls:
insecure: true
resolver:
static:
hostnames:
- localhost:5317
- localhost:6317
- localhost:7317
service:
pipelines:
metrics/loadbalancer:
receivers:
- otlp/loadbalancer
processors: []
exporters:
- logging/loadbalancer
- loadbalancing
metrics/backend-1:
receivers:
- otlp/backend-1
processors: []
exporters:
- logging/backend-1
metrics/backend-2:
receivers:
- otlp/backend-2
processors: []
exporters:
- logging/backend-2
metrics/backend-3:
receivers:
- otlp/backend-3
processors: []
exporters:
- logging/backend-3
Commands used to test:
> telemetrygen metrics --otlp-insecure --otlp-attributes='service.name="foo"' --metrics 100
> telemetrygen metrics --otlp-insecure --otlp-attributes='service.name="bar"' --metrics 100
> telemetrygen metrics --otlp-insecure --otlp-attributes='service.name="acme"' --metrics 100
Relevant metrics:
otelcol_exporter_sent_metric_points{exporter="logging/backend-1",service_instance_id="bbd1a465-b152-40ff-9a0f-281bad72c957",service_name="otelcontribcol",service_version="0.84.0-dev"} 100
otelcol_exporter_sent_metric_points{exporter="logging/backend-2",service_instance_id="bbd1a465-b152-40ff-9a0f-281bad72c957",service_name="otelcontribcol",service_version="0.84.0-dev"} 100
otelcol_exporter_sent_metric_points{exporter="logging/backend-3",service_instance_id="bbd1a465-b152-40ff-9a0f-281bad72c957",service_name="otelcontribcol",service_version="0.84.0-dev"} 100
otelcol_exporter_sent_metric_points{exporter="logging/loadbalancer",service_instance_id="bbd1a465-b152-40ff-9a0f-281bad72c957",service_name="otelcontribcol",service_version="0.84.0-dev"} 300
Co-authored-by: Juraci Paixão Kröhling <juraci.github@kroehling.de>
Co-authored-by: Juraci Paixão Kröhling <juraci.github@kroehling.de>
Signed-off-by: Claudio B <claudiobastos@gmail.com>
Closes open-telemetry#25858 **Description:** Add metrics exporter that will balance its metrics considering new routing choices **Link to tracking Issue:** open-telemetry#25858 **Testing:** Add tests for new routing choices and metrics exporter --------- Signed-off-by: Claudio B <claudiobastos@gmail.com> Co-authored-by: Juraci Paixão Kröhling <juraci.github@kroehling.de>
Closes #25858
Description: Add metrics exporter that will balance its metrics considering new routing choices
Link to tracking Issue: #25858
Testing: Add tests for new routing choices and metrics exporter