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

Could use data modificacion, actions, setTag, with Prometheus pull consumer. #262

Open
fwqniskg opened this issue Aug 11, 2023 · 1 comment
Labels
bug Something isn't working untriaged Issue needs to be reviewed for validity

Comments

@fwqniskg
Copy link

If it's posible to use actions with Prometheus pull consumer class?

@fwqniskg fwqniskg added bug Something isn't working untriaged Issue needs to be reviewed for validity labels Aug 11, 2023
@Nachtfalkeaw
Copy link

You can and should do this on prometheus if you use Prometheus Pull consumer:

https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config

e.g. extract the name from "[instance]" label, extract the part before the : (regex) create a new target_label with a name you like and as value of the new label (replacement) chose what you extracted from [instance]

e.g.
instance: f5_hostname:443

new_label - value pair:
My_f5_hostname=f5_hostname

metric_relabel_configs:
  - source_labels: [instance]
    separator: "@"
    regex: "([^:]+).*"
    replacement: '${1}'
    target_label: "My_f5_hostname"
    action: "replace"

this is added to all metrics.

I think to add a label there is an much easier way, too.
But I think you have to verify this somewhere in prometheus docs.

static_configs:
  - targets:
    - f5_hostname
        - labels:
          - labelname: value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Issue needs to be reviewed for validity
Projects
None yet
Development

No branches or pull requests

2 participants