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

Trouble using prometheus::server::collect_tag. #707

Open
Lveltmaat opened this issue Nov 23, 2023 · 1 comment
Open

Trouble using prometheus::server::collect_tag. #707

Lveltmaat opened this issue Nov 23, 2023 · 1 comment
Labels
needs-feedback Further information is requested

Comments

@Lveltmaat
Copy link

Hi guys,

In our datacenter we have two different environments. Each has it's own prometheus server and can only reach it's own clients. We want to use the prometheus::collect_tag for this reason. We haven't been successfull in doing so.

We tried inspecting the code but were not able to find a way to fill the tag field, for example on a client running node exporter.

In the reference I couldn't find a way to fill in a tag.

A small portion of manifests/config.pp:

$node_tag = $prometheus::server::collect_tag ? {
  Undef   => 'prometheus::scrape_job',
  default => $prometheus::server::collect_tag,
}

Prometheus::Scrape_job <<| job_name == $job_name and tag == $node_tag |>> {
  collect_dir => "${prometheus::config_dir}/file_sd_config.d",
  notify      => Class['prometheus::service_reload'],
}

Are there examples of how the collect tag portion should work?

@TheMeier
Copy link
Contributor

tag is a puppet metaparameter, see https://www.puppet.com/docs/puppet/6/metaparameter#tag. You simply set a costum tag on all exporter-resources eg like this:

class {'prometheus::node_exporter':
  tag => 'mytag',
}

and then set collect_tag to mytag on the prometheus::server that is dedicated to these resources.

@TheMeier TheMeier added the needs-feedback Further information is requested label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-feedback Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants