Skip to content
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

There should be an error when resource attributes uniqueness assumption is violated #4289

Open
eero-t opened this issue Feb 26, 2024 · 0 comments

Comments

@eero-t
Copy link
Contributor

eero-t commented Feb 26, 2024

This is continuation of v6 (Git version) issue #4283.

Expected behavior

Error of internal assumptions being violated for submitted resource attributes.

Actual behavior

No error, write_prometheus plugin reports multiple target_infos that have the same same service name + service instance ID pair:

$ curl --no-progress-meter 127.0.0.1:9999/metrics 
# HELP target_info Target metadata
# TYPE target_info gauge
target_info{job="unknown_service:collectd",instance="",dev_file="card0",host_name="icx-cp-1",pci_bdf="0000:4d:00.0",pci_dev="0x56c0"} 1
target_info{job="unknown_service:collectd",instance="",dev_file="card2",host_name="icx-cp-1",pci_bdf="0000:93:00.0",pci_dev="0x56c0"} 1
...
<the actual metrics>

Steps to reproduce

Plugin submits metrics that have the same name / labels, but a different resource.

However, although resources have different attributes, they have the same service name + service instance ID (e.g. "collectd" and "" or "pluginname"), instead of either or both of thembeing different for each resource.

This mistake is easy to do because:

  • Everything worked fine when those same name & instance ID names were labels in every metric, instead of resource attributes
  • Resource attribute being named "service.instance.id" does not really give the indication that it should contain ID for some other thing (e.g. device) than "service"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant