This feature implements the drop dimension part of #5791.
The dropping of dimensions is not applicable to all stats vars.
We drop dimensions for counters and timings, but not gauges.
This also doesn't work for func based vars, but those are now
unused for counters and timings.
The feature doesn't actually drop the dimension. Instead, it
consolidates all the different values into a single "all"
category. This approach is more backward compatible and allows
for going back and forth, because the label itself continues
to exist in both scenarios.
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
This ensures that the number of labels at parse time equals the number of labels at join time.
Without this, some metrics exporters can get confused and panic().
Signed-off-by: David Weitzman <dweitzman@pinterest.com>
Instead, all code should use "CountersFuncWithMultiLabels" with a single label instead.
There was only one place in the codebase (binlog_players.go) which had to be changed.
Signed-off-by: Michael Berlin <mberlin@google.com>
Now the function signatures are consistent with all other constructors.
Other changes:
- Do not repeat the type in function signatures when it's the same.
- Do not use receiver names with more than 2 letters.
- Do not use pointer receiver if you don't want to modify the object.
Signed-off-by: Michael Berlin <mberlin@google.com>
Fix tests to use the new metric names.
Fix tests that expected gauges and not counters. (more to come on this
thing, but these were the tests that indicated gauges early)
Fix the `Set()` implementation for GaugesWithMultiLabels.
Signed-off-by: Maggie Zhou <mzhou@slack-corp.com>
pull_backend.go stuff into prombackend/prombackend.go's Register call
and make the pull_backend.go an interface only.
Also, fix some more types from the gigantic refactor, and run
GoLint/GoVet
Signed-off-by: Maggie Zhou <mzhou@slack-corp.com>
Please refer to #2694 and #2670 for motivation and reasoning for
this change.
I've tried to follow best practice in inserting the copyright
headers. In other open source projects, not all files carry
the notice. For example documentation doesn't. I've followed
similar ground rules.
I did not change the php because there is a separate LICENSE
file there by Pixel Federation. We'll first need to notify
them our intent before changing anything there.
As for the presubmit check, it's going to be non-trivial
because of the number of exceptions, like file types,
directories and generated code. So, it will have to be
a separate project.
Precreate some of the counter labels at the beginning.
This eliminates some monitoring jitters where an absent
label is not treated as zero value. We should ideally do
this to all stats counters. This is just some low hanging
fruit for now.