Hello.
I am using the official integration of Grafana cloud for Docker and followed the instructions to setup alloy with the provided configurations.
The integration is reporting metrics and the logs are working fine.
But the default Docker integration dashboard is not showing correctly.
The metrics are being ingested, but I think there are some missing labels to identify each container.
This is what I see in the metrics explorer:
container_last_seen{cluster="test",id="/",instance="webserver-01",job="integrations/docker"}
I am using the default configuration suggested by the integration
prometheus.exporter.cadvisor "integrations_cadvisor" {
docker_only = true
}
discovery.relabel "integrations_cadvisor" {
targets = prometheus.exporter.cadvisor.integrations_cadvisor.targets
rule {
target_label = "job"
replacement = "integrations/docker"
}
rule {
target_label = "instance"
replacement = constants.hostname
}
}
prometheus.relabel "integrations_cadvisor" {
forward_to = [prometheus.remote_write.metrics_service.receiver]
rule {
source_labels = ["__name__"]
regex = "up|container_cpu_usage_seconds_total|container_fs_inodes_free|container_fs_inodes_total|container_fs_limit_bytes|container_fs_usage_bytes|container_last_seen|container_memory_usage_bytes|container_network_receive_bytes_total|container_network_tcp_usage_total|container_network_transmit_bytes_total|container_spec_memory_reservation_limit_bytes|machine_memory_bytes|machine_scrape_error"
action = "keep"
}
}
prometheus.scrape "integrations_cadvisor" {
targets = discovery.relabel.integrations_cadvisor.output
forward_to = [prometheus.relabel.integrations_cadvisor.receiver]
}
I am using docker in swarm mode? could that be related? Logs are working fine.
Thank you for your help.