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

bug: Configuration reload does not affect bucket configuration #471

Open
pedro-stanaka opened this issue Sep 28, 2022 · 3 comments
Open
Labels
bug help wanted PRs for this issue are especially welcome

Comments

@pedro-stanaka
Copy link
Contributor

Bug description

What is happening?

  1. I start the exporter with a mapping configuration (see example config at the end).
  2. I send some samples of the metric constantly (before metric had chance to churn)
  3. I change mapping configuration and update the bucked layout for my metrics
  4. I trigger a reload via sighup/web lifecycle
  5. After sending new samples, old bucket configuration is still present and not new, updated one.

This is happening because the metric is never deleted after the reload from the Registry.

What you expected to happen?

On step 5. I would expect the new bucket configuration to take place.

Notes

Example config:

defaults:
    ttl: 3m
    match_type: regex
    observer_type: histogram
    histogram_options:
        buckets: [0.1, 0.25, 150, 500, 900]
mappings:
    - match: \bexample_metric\b
      observer_type: histogram
      histogram_options:
        buckets: [10, 40, 50, 80, 100, 120, 150, 200, 250]
      name: example_metric
      labels:
        statsd_exporter_config_mapping: "true"
@matthiasr matthiasr added bug help wanted PRs for this issue are especially welcome and removed help wanted PRs for this issue are especially welcome labels Sep 28, 2022
@matthiasr
Copy link
Contributor

Interesting! I don't know what a good solution is here tbh.

The "easiest" way to fix this would be to clear the registry on reload, but I think that would be very very disruptive. OTOH, we can't really predict from the mappings alone which metrics need clearing. Maybe we would need to defer this decision until a sample is ingested into a metric with conflicting bucket configuration, but then that would un-align metric resets 🤔

@matthiasr matthiasr added dependencies Pull requests that update a dependency file help wanted PRs for this issue are especially welcome and removed dependencies Pull requests that update a dependency file labels Sep 28, 2022
@pedro-stanaka
Copy link
Contributor Author

pedro-stanaka commented Sep 30, 2022

One team mate came up with a solution that whenever there is a hot-reload of the configuration we delete all metrics that are configured in the mapping file from the registry (for us, that is disruptive, but acceptable). We are going to test that and come back with results. Would the repo be interested in such solution?

@matthiasr
Copy link
Contributor

Hmm, yes, but let's make it opt-in with a command line flag. I don't want to force the clearing on everyone since it's not usually necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted PRs for this issue are especially welcome
Projects
None yet
Development

No branches or pull requests

2 participants