sentrysoftware / metricshub

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

Add support for `host.id`, `host.name`, and other attributes as arrays in resource configuration #470

Closed NassimBtk closed 4 days ago

NassimBtk commented 3 weeks ago

Issue Description:

Based on feedback, we propose a more generic approach for supporting multiple resources with shared attributes in MetricsHub. Instead of introducing specific properties like host.names (plural) that map artificially to multiple host.name (singular) attributes, we can use host.name (singular) and check if it is an array. If it is an array, this resource will be treated as a "multiple-resource" resource, with all attributes defined as arrays split accordingly.

Proposed Enhancement

Example Configuration:

resources:
  <resource-id>:
    attributes:
      host.name: [<hostname1>, <hostname2>, etc.]
      host.id: [<id1>, <id2>, etc.]
      host.type: <type>
    <protocol-configuration>