Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cluster name in alloy metrics #1364

Closed
petewall opened this issue Jul 26, 2024 · 2 comments · Fixed by #1679
Closed

Use cluster name in alloy metrics #1364

petewall opened this issue Jul 26, 2024 · 2 comments · Fixed by #1679
Assignees

Comments

@petewall
Copy link
Contributor

Request

When --cluster.name is specified, use that in relevant metrics, like alloy_config_hash

Use case

This will help differentiate between configs from the same alloy cluster or different alloy clusters.

@petewall petewall added the enhancement New feature or request label Jul 26, 2024
@f9n
Copy link

f9n commented Jul 27, 2024

For those who need it, you can add cluster label for all metrics as below until this development arrives. We deploy the Alloy to virtual machines. While deploying Alloy, we add the CLUSTER_IDENTIFIER environment variable to the service definition with ansible role.

prometheus.exporter.self "default" {}

prometheus.scrape "selfmonitor" {
    targets = concat(
      prometheus.exporter.self.default.targets,
    )

    forward_to = [prometheus.relabel.selfmonitor.receiver]
}

prometheus.relabel "selfmonitor" {
    forward_to = ["..."]

    rule {
      action        = "replace"
      target_label  = "cluster"
      replacement   = env("CLUSTER_IDENTIFIER")
    }
}

Copy link
Contributor

This issue has not had any activity in the past 30 days, so the needs-attention label has been added to it.
If the opened issue is a bug, check to see if a newer release fixed your issue. If it is no longer relevant, please feel free to close this issue.
The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your issue will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity.
Thank you for your contributions!

@wildum wildum self-assigned this Sep 13, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants