pinot icon indicating copy to clipboard operation
pinot copied to clipboard

Update metric rules to emit database as a label

Open shounakmk219 opened this issue 1 year ago • 5 comments

Description

This PR

  1. Fixes the broken metrics for table names with database context by introducing pattern to match database prefix
  2. Extracts the database name from metric table name and adds it as a metric label named database while emitting

Testing

  • Ensure existing tests around metric checks pass
  • Manually compared the metrics endpoint payload by running the quickstart before and after the changes. Both the payloads are equivalent.

labels

bugfix observability

release-notes

Table related metrics will include database name as a metric label

shounakmk219 avatar Mar 28 '24 06:03 shounakmk219

Codecov Report

Attention: Patch coverage is 5.00000% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 62.01%. Comparing base (59551e4) to head (002fea1). Report is 202 commits behind head on master.

Files Patch % Lines
...apache/pinot/common/metrics/ValidationMetrics.java 0.00% 14 Missing :warning:
...g/apache/pinot/common/metrics/AbstractMetrics.java 20.00% 3 Missing and 1 partial :warning:
...controller/helix/core/minion/PinotTaskManager.java 0.00% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #12739      +/-   ##
============================================
+ Coverage     61.75%   62.01%   +0.26%     
+ Complexity      207      198       -9     
============================================
  Files          2436     2461      +25     
  Lines        133233   134744    +1511     
  Branches      20636    20819     +183     
============================================
+ Hits          82274    83568    +1294     
- Misses        44911    45027     +116     
- Partials       6048     6149     +101     
Flag Coverage Δ
custom-integration1 <0.01% <0.00%> (-0.01%) :arrow_down:
integration <0.01% <0.00%> (-0.01%) :arrow_down:
integration1 <0.01% <0.00%> (-0.01%) :arrow_down:
integration2 0.00% <0.00%> (ø)
java-11 34.93% <5.00%> (-26.78%) :arrow_down:
java-21 61.90% <5.00%> (+0.28%) :arrow_up:
skip-bytebuffers-false 61.98% <5.00%> (+0.23%) :arrow_up:
skip-bytebuffers-true 61.87% <5.00%> (+34.15%) :arrow_up:
temurin 62.01% <5.00%> (+0.26%) :arrow_up:
unittests 62.01% <5.00%> (+0.26%) :arrow_up:
unittests1 46.73% <5.26%> (-0.16%) :arrow_down:
unittests2 27.99% <0.00%> (+0.26%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Mar 28 '24 07:03 codecov-commenter

Can you please also explain how we tested it in the description section? Otherwise, looks good to me.

zhtaoxiang avatar Apr 02 '24 04:04 zhtaoxiang

@zhtaoxiang Updated the PR description with testing performed.

shounakmk219 avatar Apr 02 '24 04:04 shounakmk219

@zhtaoxiang Updated the rules to work with dot in table name without the need of masking it. Table name label will include the database prefix as suggested by @Jackie-Jiang but the database label will be missing for metrics on default database as there is no way to provide default value on missing values in the rules.

shounakmk219 avatar Apr 04 '24 06:04 shounakmk219

Are we able to filter on empty database?

@Jackie-Jiang database = "" should work for default db filtering.

Will it be empty string or null?

The database label will be missing on metric

shounakmk219 avatar Apr 04 '24 17:04 shounakmk219