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

[DPE-5706] remove clutter from singlestat panels in cos #702

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lucasgameiroborges
Copy link
Member

@lucasgameiroborges lucasgameiroborges commented Dec 17, 2024

Issue

This PR focuses on addressing #656 in particular.

Solution

This comes down to select the appropriate value (amongst the possible juju-unit labels) and display it on the singlestat panel. There are 3 main cases:

  • Workload versions (PG or Patroni): Since we don't support cross-version upgrades, they should be the same across all units, so we could choose any value. Since they are not integers, using aggregation functions like avg or min/max doesn't work, hence the usage of topk(1, <version_metric>) to just pick a value.
  • Timestamps: Must decide if we want to keep the most recent max or oldest min timestamp among the possible unit's values. Depends on the metric, will put comments on what was chosen and where.
  • Config values: Should also be consistent across units 99% of the time, but can also be aggregated using min/max, just in case they end up being different. Here, I chose to pick the largest value by default.

Please, let me know if all this makes sense!

@@ -212,7 +212,7 @@
"tableColumn": "",
"targets": [
{
"expr": "process_start_time_seconds{release=\"$release\", instance=\"$instance\"} * 1000",
"expr": "min(process_start_time_seconds{release=\"$release\", instance=\"$instance\"} * 1000) by (label)",
Copy link
Member Author

Choose a reason for hiding this comment

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

Picks the oldest start time across the selected units.

@@ -246,7 +246,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "patroni_dcs_last_seen{service_name=~\"$service_name\",scope=~\"$scope_name\"}*1000",
"expr": "max(patroni_dcs_last_seen{service_name=~\"$service_name\",scope=~\"$scope_name\"}*1000) by (label)",
Copy link
Member Author

Choose a reason for hiding this comment

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

Picks the most recent Last Seen time across selected units

@@ -826,7 +826,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "patroni_postmaster_start_time{service_name=~\"$service_name\",scope=~\"$scope_name\"}*1000",
"expr": "min(patroni_postmaster_start_time{service_name=~\"$service_name\",scope=~\"$scope_name\"}*1000) by (label)",
Copy link
Member Author

Choose a reason for hiding this comment

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

picks the oldest start time across selected units

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.82%. Comparing base (5c8949f) to head (6bd4aad).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #702   +/-   ##
=======================================
  Coverage   71.82%   71.82%           
=======================================
  Files          13       13           
  Lines        3219     3219           
  Branches      477      477           
=======================================
  Hits         2312     2312           
  Misses        791      791           
  Partials      116      116           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@marceloneppel marceloneppel left a comment

Choose a reason for hiding this comment

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

Those changes make sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants