sentrysoftware / metricshub

Universal Metrics Collection for OpenTelemetry
https://metricshub.com
GNU Affero General Public License v3.0
15 stars 4 forks source link

Issue #468: Support shared-characteristics for centralized resources #469

Closed NassimBtk closed 3 weeks ago

NassimBtk commented 3 weeks ago

Update

Details This pull request to metricshub-agent introduces changes to the PostConfigDeserializer class to manage ResourceConfig instances more effectively by resolving multiple host configurations. The most important changes include adding a new method to handle ResourceConfig instances and updating the deserialization logic to incorporate this method.

Enhancements to deserialization logic:

New method for ResourceConfig resolution:

Tests image

bertysentry commented 3 weeks ago

One comment or suggestion I'd like to make: instead of having a specific host.names (plural) property that is artificially mapped to several host.name (singular) attribute, we could use host.name (singular), and check if it's an array. If it's an array, then it's a "multiple-resource" resource, and we split all attributes that are arrays.

This way, we would remain perfectly generic and could have "multiple-resource" resource using other attributes than host.name(s).

WDYT? 😅

NassimBtk commented 3 weeks ago

Great idea @bertysentry, thank you! We can handle this in a new feature request to add support for host.id or other attributes as arrays (ensuring matching array lengths 😉).

NassimBtk commented 3 weeks ago

Further enhancements will be made through https://github.com/sentrysoftware/metricshub/issues/470.