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

statsd_exporter too opinionated about mappings #680

Open
chadh opened this issue Jul 21, 2023 · 2 comments
Open

statsd_exporter too opinionated about mappings #680

chadh opened this issue Jul 21, 2023 · 2 comments

Comments

@chadh
Copy link

chadh commented Jul 21, 2023

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: all
  • Ruby: all
  • Distribution: all
  • Module version: all

Any additional information you'd like to impart

We use a /etc/statsd-exporter-mapping.yaml that looks like this:

defaults:
  observer_type: histogram
  timer_type: histogram
  buckets: [ 0.5, 0.7, 0.9, 1.1, 1.3, 1.5, 2.0 ]
  match_type: glob
  glob_disable_ordering: false
  ttl: 0 # metrics do not expire
mappings:
- match: "(.*).counters\\.(.*)\\.(.*)\\.(.*)\\.(.*)\\.(.*)"
  match_type: regex
  name: "counters_$2_$3_$4_$5"
  labels:
      hostname: "$1"
      class: "$2"
      method: "$3"
      function: "$4"
      type: "$5"
      count: "$6"
- match: "(.*)\\.(filecount.*)\\.(.*)"
  ...

The prometheus::statsd_exporter assumes only a mappings hash in the config. Rather than only passing in the contents of th mappings hash, it should either allow the entire file contents, or even just allow the user to manage the file.

@TheMeier
Copy link
Contributor

TheMeier commented May 5, 2024

care to provide a PR implementing that @chadh ?

@chadh
Copy link
Author

chadh commented May 5, 2024

Ah yeah, I should have submitted our workaround. I don't know if y'all want to address it the same way, but I just made it optional, and then added a resource to the profile with the contents we wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants