Closed dhilgarth closed 7 months ago
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself.
@dhilgarth have you considered using the resourceprocessor
to add the service name attribute?
@jamesmoessis Thanks, this works beautifully
receivers:
...
docker_stats:
...
processors:
...
resource:
attributes:
- key: container.name
pattern: ^(?P<container_service_name>[^.]+)\..*
action: extract
exporters:
...
service:
pipelines:
...
metrics/generic:
receivers: [ docker_stats, ... ]
processors: [ resource, ... ]
exporters: [ ... ]
Component(s)
receiver/dockerstats
Is your feature request related to a problem? Please describe.
In Docker Swarm, the unit of aggregation I often care about is the total usage of a service per host. This is currently not possible.
Describe the solution you'd like
Add a new attribute for the service name
Describe alternatives you've considered
container_name
, e.g. vialabel_replace
in PromQL: Works, but is quite a handful which I would need to use in each query instead of simply selecting the label. For reference:label_replace(container_memory_usage_total, "container_service_name", "$1", "container_name", "^([^.]+)\\..*")
Additional context
No response