You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the discovered pod metadata labels (discovered_labels, see https://grafana.com/docs/alloy/latest/reference/components/loki/loki.source.podlogs/#podlogsspec) are only available in the RelabelConfig of the PodLogs CR. I would like to archive that the discovered labels/discovered_labels from loki.source.podlogs are available in a loki.relabel component, so I can relabel the logs without appending common relabeling rules to every PodLogs CR.
I suggest to make it possible to keep discovered labels from loki.source.podlogs, so they are available in the component the logs are being forwarded to. There are at least two options:
Option 1
Add a boolean option to loki.source.podlogs to keep and forward all discovered labels.
Option 2
Add a block for relabing rules to loki.source.podlogs. The relabeling rules the could be merged with the rules from the PodLogs CR or could be applied beforehand.
The text was updated successfully, but these errors were encountered:
Background
Currently the discovered pod metadata labels (
discovered_labels
, see https://grafana.com/docs/alloy/latest/reference/components/loki/loki.source.podlogs/#podlogsspec) are only available in theRelabelConfig
of thePodLogs
CR. I would like to archive that the discovered labels/discovered_labels
fromloki.source.podlogs
are available in aloki.relabel
component, so I can relabel the logs without appending common relabeling rules to everyPodLogs
CR.I've attached the current configuration below.
Alloy component graph:
loki.source.podlogs
-->loki.relabel
-->loki.write
config.alloy
loki.source.podlogs "podlogs" { clustering { enabled = true } forward_to = [loki.relabel.podlogs.receiver] } loki.relabel "podlogs" { forward_to = [loki.write.local.receiver] rule { action = "replace" source_labels = ["__meta_kubernetes_namespace"] target_label = "namespace" } rule { action = "replace" source_labels = ["__meta_kubernetes_pod_name"] target_label = "pod" } rule { action = "replace" source_labels = ["__meta_kubernetes_pod_container_name"] target_label = "container_name" } rule { action = "replace" source_labels = ["__meta_kubernetes_pod_node_name"] target_label = "node" } rule { action = "replace" source_labels = ["__meta_kubernetes_pod_label_app_kubernetes_io_instance"] target_label = "instance" } rule { action = "replace" source_labels = ["__meta_kubernetes_pod_label_app_kubernetes_io_name"] target_label = "app" } } loki.write "local" { endpoint { url = "http://loki-gateway.loki:80/loki/api/v1/push" } }
example-podlogs.yaml
Proposal
I suggest to make it possible to keep discovered labels from
loki.source.podlogs
, so they are available in the component the logs are being forwarded to. There are at least two options:Option 1
Add a boolean option to
loki.source.podlogs
to keep and forward all discovered labels.Option 2
Add a block for relabing rules to
loki.source.podlogs
. The relabeling rules the could be merged with the rules from thePodLogs
CR or could be applied beforehand.The text was updated successfully, but these errors were encountered: