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

monitoring/grafana: Replace missing legendFormat warning with error. #44332

Merged
merged 6 commits into from Jan 19, 2022

Conversation

pereman2
Copy link
Contributor

@pereman2 pereman2 commented Dec 16, 2021

In #43669 we introduced a warning to detect duplicate title, legendFormat keys. In this PR this warning message it's changed to an error so that we won't allow duplicate keys to happen in order to improve the reliability of grafana tests.

The first commit will be deleted after #44190 is merged.

Fixes: https://tracker.ceph.com/issues/53754
Signed-off-by: Pere Diaz Bou pdiazbou@redhat.com

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@pereman2 pereman2 requested a review from a team as a code owner December 16, 2021 14:14
@pereman2 pereman2 added this to In progress in Dashboard via automation Dec 16, 2021
@pereman2 pereman2 requested review from avanthakkar, aaSharma14 and alfonsomthd and removed request for a team December 16, 2021 14:14
@@ -344,7 +344,7 @@ local addStyle(alias, colorMode, colors, dateFormat, decimals, mappingType, patt
local RbdDetailsPanel(title, formatY1, expr1, expr2, x, y, w, h) =
graphPanelSchema({}, title, '', 'null as zero', false, formatY1, formatY1, null, null, 0, 1, '$Datasource')
.addTargets(
[addTargetSchema(expr1, 1, 'time_series', 'Write'),addTargetSchema(expr2, 1, 'time_series', 'Read')]) + {gridPos: {x: x, y: y, w: w, h: h}};
[addTargetSchema(expr1, 1, 'time_series', '{{pool}} Write'),addTargetSchema(expr2, 1, 'time_series', '{{pool}} Read')]) + {gridPos: {x: x, y: y, w: w, h: h}};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this because it conflicts with rbd-overview.json. If I understood it correctly, rbd-details provides metrics for each rbd pool so I thought that {{pool}} would be more specific and therefore make this work? @aaSharma14 you know more about this, what do you think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +486 to +995
[addTargetSchema('(ceph_pool_compress_under_bytes / ceph_pool_compress_bytes_used > 0) and on(pool_id) (((ceph_pool_compress_under_bytes > 0) / ceph_pool_stored_raw) * 100 > 0.5)', 1, 'table', 'A'),
addTargetSchema('ceph_pool_max_avail * on(pool_id) group_left(name) ceph_pool_metadata', 1, 'table', 'B'),
addTargetSchema('((ceph_pool_compress_under_bytes > 0) / ceph_pool_stored_raw) * 100', 1, 'table', 'C'),
addTargetSchema('(ceph_pool_percent_used * on(pool_id) group_left(name) ceph_pool_metadata)', 1, 'table', 'D'),
addTargetSchema('(ceph_pool_compress_under_bytes - ceph_pool_compress_bytes_used > 0)', 1, 'table', 'E'),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here since tables don't care about the legend format I added these legendFormat arbitrarily.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe in a follow-up PR we should add a meaningful name for legendFormat in all tables: AFAIK this is displayed when you explore the table details.

@@ -634,8 +634,7 @@ local addStyle(alias, colorMode, colors, dateFormat, decimals, mappingType, patt
{"Non-Encrypted": "#E5AC0E"}, '', 'OSD Objectstore Types'
)
.addTarget(addTargetSchema('count(ceph_bluefs_wal_total_bytes)', 1, 'time_series', 'bluestore'))
.addTarget(addTargetSchema('count(ceph_osd_metadata) - count(ceph_bluefs_wal_total_bytes)', 1, 'time_series', 'filestore'))
.addTarget(addTargetSchema('absent(ceph_bluefs_wal_total_bytes)*count(ceph_osd_metadata)', 1, 'time_series', 'filestore')) + {gridPos: {x: 4, y: 8, w: 4, h: 8}},
.addTarget(addTargetSchema('count(ceph_osd_metadata) - count(ceph_bluefs_wal_total_bytes)', 1, 'time_series', 'filestore')) + {gridPos: {x: 4, y: 8, w: 4, h: 8}},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were 2 filestore counts? I removed one that wasn't correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? I have no clue about what this was for... :S Maybe @pcuzner recalls...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pcuzner ping

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epuertat
image
I deleted the wrong one :PPPPPP . In ceph-dev with 5 filestore osds you can see the output of both of the queries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in last commit

@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@@ -171,7 +171,8 @@ def run_promtool(self):

for variable, value in self.variables.items():
expr = self.promql_expr_test.expr
new_expr = re.sub(r'\${0}'.format(variable), str(value), expr)
regex = fr'\${variable}(?=\W)'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the positive look-ahead? What exactly are you trying to match/not to match here? You could express that as a doctest (you'd need to extract part of this function and isolate the string processing code).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The positive lookahead is because I don't want to replace that part, but I need it to make a match.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epuertat ping

monitoring/grafana/dashboards/tests/__init__.py Outdated Show resolved Hide resolved
monitoring/grafana/dashboards/tests/util.py Outdated Show resolved Hide resolved
@@ -634,8 +634,7 @@ local addStyle(alias, colorMode, colors, dateFormat, decimals, mappingType, patt
{"Non-Encrypted": "#E5AC0E"}, '', 'OSD Objectstore Types'
)
.addTarget(addTargetSchema('count(ceph_bluefs_wal_total_bytes)', 1, 'time_series', 'bluestore'))
.addTarget(addTargetSchema('count(ceph_osd_metadata) - count(ceph_bluefs_wal_total_bytes)', 1, 'time_series', 'filestore'))
.addTarget(addTargetSchema('absent(ceph_bluefs_wal_total_bytes)*count(ceph_osd_metadata)', 1, 'time_series', 'filestore')) + {gridPos: {x: 4, y: 8, w: 4, h: 8}},
.addTarget(addTargetSchema('count(ceph_osd_metadata) - count(ceph_bluefs_wal_total_bytes)', 1, 'time_series', 'filestore')) + {gridPos: {x: 4, y: 8, w: 4, h: 8}},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? I have no clue about what this was for... :S Maybe @pcuzner recalls...

@pereman2 pereman2 changed the title [AFTER #44190 ] monitoring/grafana: Replace missing legendFormat warning with error. monitoring/grafana: Replace missing legendFormat warning with error. Jan 3, 2022
@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
@alfonsomthd
Copy link
Contributor

jenkins test dashboard cephadm

Dashboard automation moved this from In progress to Reviewer approved Jan 19, 2022
Comment on lines +486 to +995
[addTargetSchema('(ceph_pool_compress_under_bytes / ceph_pool_compress_bytes_used > 0) and on(pool_id) (((ceph_pool_compress_under_bytes > 0) / ceph_pool_stored_raw) * 100 > 0.5)', 1, 'table', 'A'),
addTargetSchema('ceph_pool_max_avail * on(pool_id) group_left(name) ceph_pool_metadata', 1, 'table', 'B'),
addTargetSchema('((ceph_pool_compress_under_bytes > 0) / ceph_pool_stored_raw) * 100', 1, 'table', 'C'),
addTargetSchema('(ceph_pool_percent_used * on(pool_id) group_left(name) ceph_pool_metadata)', 1, 'table', 'D'),
addTargetSchema('(ceph_pool_compress_under_bytes - ceph_pool_compress_bytes_used > 0)', 1, 'table', 'E'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe in a follow-up PR we should add a meaningful name for legendFormat in all tables: AFAIK this is displayed when you explore the table details.

Copy link
Member

@epuertat epuertat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@epuertat
Copy link
Member

cephadm failure but unrelated.

@epuertat epuertat merged commit 3e6afc3 into ceph:master Jan 19, 2022
Dashboard automation moved this from Reviewer approved to Done Jan 19, 2022
@epuertat epuertat deleted the grafana-warnings branch January 19, 2022 12:18
@epuertat
Copy link
Member

@pereman2 shouldn't this be a quincy backport?

@epuertat epuertat added the needs-quincy-backport backport required for quincy label Jan 19, 2022
@epuertat epuertat removed the needs-quincy-backport backport required for quincy label Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Dashboard
  
Done
3 participants