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

Use base units for metrics #227

Merged
merged 1 commit into from Apr 15, 2019
Merged

Use base units for metrics #227

merged 1 commit into from Apr 15, 2019

Conversation

SuperQ
Copy link
Contributor

@SuperQ SuperQ commented Apr 15, 2019

Prometheus best practice0 is to use base units. Use seconds
instead of milliseconds.

@coveralls
Copy link

coveralls commented Apr 15, 2019

Pull Request Test Coverage Report for Build 3048

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 67.52%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/vm/vm.go 0 1 0.0%
Totals Coverage Status
Change from base Build 3026: 0.0%
Covered Lines: 3823
Relevant Lines: 5662

💛 - Coveralls

Prometheus best practice[0] is to use base units. Use seconds
instead of milliseconds.
* Setup new buckets based on testing.

[0]: https://prometheus.io/docs/practices/naming/#base-units
@SuperQ
Copy link
Contributor Author

SuperQ commented Apr 15, 2019

Here's what I got back for reasonable buckets:

mtail_vm_line_processing_duration_seconds_bucket{prog="haproxy.mtail",le="2e-05"} 6027
mtail_vm_line_processing_duration_seconds_bucket{prog="haproxy.mtail",le="4e-05"} 210214
mtail_vm_line_processing_duration_seconds_bucket{prog="haproxy.mtail",le="8e-05"} 1.011226e+06
mtail_vm_line_processing_duration_seconds_bucket{prog="haproxy.mtail",le="0.00016"} 1.023589e+06
mtail_vm_line_processing_duration_seconds_bucket{prog="haproxy.mtail",le="0.00032"} 1.025368e+06
mtail_vm_line_processing_duration_seconds_bucket{prog="haproxy.mtail",le="0.00064"} 1.026172e+06
mtail_vm_line_processing_duration_seconds_bucket{prog="haproxy.mtail",le="0.00128"} 1.026269e+06
mtail_vm_line_processing_duration_seconds_bucket{prog="haproxy.mtail",le="0.00256"} 1.026319e+06
mtail_vm_line_processing_duration_seconds_bucket{prog="haproxy.mtail",le="0.00512"} 1.026324e+06
mtail_vm_line_processing_duration_seconds_bucket{prog="haproxy.mtail",le="0.01024"} 1.026324e+06
mtail_vm_line_processing_duration_seconds_bucket{prog="haproxy.mtail",le="+Inf"} 1.026325e+06

@jaqx0r
Copy link
Contributor

jaqx0r commented Apr 15, 2019

I worry about dynamic range of small floats, but ok.

@jaqx0r jaqx0r merged commit c95b546 into google:master Apr 15, 2019
@SuperQ SuperQ deleted the superq/line_base_unit branch April 16, 2019 08:34
@SuperQ
Copy link
Contributor Author

SuperQ commented Apr 16, 2019

Shouldn't be a problem for float64. There are always 52 bits for fraction and 11 bits for exponent.

tangdi pushed a commit to tangdi/mtail that referenced this pull request May 20, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants