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

Format fails for quantile summary when run before the 1st observe #145

Open
Scott2e opened this issue Aug 31, 2022 · 1 comment
Open

Format fails for quantile summary when run before the 1st observe #145

Scott2e opened this issue Aug 31, 2022 · 1 comment

Comments

@Scott2e
Copy link

Scott2e commented Aug 31, 2022

It seems when declaring a new quantile_summary metric without labels, and reading from it (using prometheus_text_format.format) before any values are observed, an error occurs.

iex(1)> :prometheus_quantile_summary.declare([name: :test_blah, help: "help test"])
true
iex(2)> :prometheus_text_format.format(:default)
** (FunctionClauseError) no function clause matching in :quantile_estimator.quantile/6    
    
    The following arguments were given to :quantile_estimator.quantile/6:
    
        # 1
        0.5
    
        # 2
        #Function<1.111378939/2 in :quantile_estimator.f_targeted/1>
    
        # 3
        []
    
        # 4
        0
    
        # 5
        0
    
        # 6
        :undefined
    
    (quantile_estimator 0.2.1) deps/quantile_estimator/src/quantile_estimator.erl:152: :quantile_estimator.quantile/6
    (prometheus 4.9.1) src/metrics/prometheus_quantile_summary.erl:476: :prometheus_quantile_summary."-quantile_values/2-lc$^0/1-0-"/2
    (prometheus 4.9.1) src/metrics/prometheus_quantile_summary.erl:358: anonymous fn/6 in :prometheus_quantile_summary.collect_metrics/2
    (prometheus 4.9.1) src/model/prometheus_model_helpers.erl:131: :prometheus_model_helpers.create_mf/5
    (prometheus 4.9.1) src/metrics/prometheus_quantile_summary.erl:336: :prometheus_quantile_summary."-collect_mf/2-lc$^0/1-0-"/3
    (prometheus 4.9.1) src/metrics/prometheus_quantile_summary.erl:337: :prometheus_quantile_summary.collect_mf/2
    (prometheus 4.9.1) src/prometheus_collector.erl:156: :prometheus_collector.collect_mf/3
    (prometheus 4.9.1) src/prometheus_registry.erl:86: :prometheus_registry."-collect/2-lc$^0/1-0-"/3
@Scott2e Scott2e changed the title Format fails for quantile summary when run before the 1st obsere Format fails for quantile summary when run before the 1st observe Aug 31, 2022
@Scott2e
Copy link
Author

Scott2e commented Sep 7, 2022

Looks like there's a PR to fix this #132

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

1 participant