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

Support recording and switching between naive and classic latency histograms #1150

Merged
merged 14 commits into from
Apr 24, 2024

Conversation

krajorama
Copy link
Contributor

@krajorama krajorama commented Feb 23, 2024

Support migration of latency histograms by allowing the user to chose between which one to show: native or classic ?

Also add plumbing for recording related native histogram series.

@krajorama krajorama marked this pull request as draft February 23, 2024 17:42
@krajorama krajorama changed the title Krajo/native histogram mixin simple Support recording and switching between naive and classic latency histograms Feb 26, 2024
@krajorama krajorama marked this pull request as ready for review February 26, 2024 11:02
@krajorama krajorama force-pushed the krajo/native-histogram-mixin-simple branch from 097af75 to 9a9ab64 Compare March 14, 2024 07:25
Give utilities to generate native and classic queries over generic
histogram metrics defined by a metric name and selectors.
Allow to define panels that can switch between showing either.

Native histograms are
https://grafana.com/docs/mimir/latest/send/native-histograms/

Signed-off-by: György Krajcsovits <[email protected]>
@krajorama krajorama force-pushed the krajo/native-histogram-mixin-simple branch from 9a9ab64 to 56fe626 Compare March 14, 2024 07:45
Copy link
Contributor

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

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

Not sure what I am supposed to review here. The Grafana magic is way beyond me. The PromQL queries look OK at first glance, but I should probably see the resulting queries in action to really tell.

@krajorama
Copy link
Contributor Author

Not sure what I am supposed to review here. The Grafana magic is way beyond me. The PromQL queries look OK at first glance, but I should probably see the resulting queries in action to really tell.

I'd say this is optional for you @beorn7 , not a lot to do with PromQL. Usage is in grafana/mimir#7674 and I have a prototype running, I'll share the link in DM

Copy link

@johannaratliff johannaratliff left a comment

Choose a reason for hiding this comment

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

Nothing crazy sticks out to me. Approved as a utils/usage experience

@krajorama krajorama merged commit 2860a02 into master Apr 24, 2024
2 checks passed
@krajorama krajorama deleted the krajo/native-histogram-mixin-simple branch April 24, 2024 09:13
CharlieTLe added a commit to CharlieTLe/cortex-jsonnet that referenced this pull request Jul 21, 2024
Updates grafana-builder and mixin-utils to latest version in master branch. This will be helpful in creating Grafana panels that use the timeseriesPanel instead of the deprecated panel.

grafana-builder changes:

- grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285)
- More native histograms related utils and renaming (grafana/jsonnet-libs#1270)
- Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150)
- Basic native histogram utilities (grafana/jsonnet-libs#1164)
- grafana-builder: rename template variable "Data Source" to "Data source" (grafana/jsonnet-libs#1111)
- Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825)
- Allow dashboards to show gRPC codes as labels (grafana/jsonnet-libs#1098)
- Allow configuring sort order for variables (grafana/jsonnet-libs#1014)
- remove unused/wrong step param (grafana/jsonnet-libs#999)
- Show cancelled requests in grey on QPS dashboards. (grafana/jsonnet-libs#988)
- Show cancelled requests in yellow on QPS dashboards. (grafana/jsonnet-libs#986)
- Add timeseriesPanel (grafana/jsonnet-libs#824)
- Allow including "All" for single template var
- Allow datasource's regex to be configured
- grafana-builder: make allValue configurable (grafana/jsonnet-libs#703)
- grafana_builder: add dashboard link func (grafana/jsonnet-libs#683)
- Add 'Data Source' label for the default datasource template variable. (grafana/jsonnet-libs#672)
- enable toolip by default (grafana/jsonnet-libs#665)

mixin-utils changes:

- grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285)
- More native histograms related utils and renaming (grafana/jsonnet-libs#1270)
- nativeClassicSumBy: format list of labels nicer (grafana/jsonnet-libs#1204)
- Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150)
- chore: fix hardcoded range interval (grafana/jsonnet-libs#1190)
- Basic native histogram utilities (grafana/jsonnet-libs#1164)
- utils: allow defining native histogram recording rule (grafana/jsonnet-libs#1156)
- modify withRunbookURL to allow internal annotation (grafana/jsonnet-libs#1139)
- mixin-utils: drop unsupported step target parameter (grafana/jsonnet-libs#1128)
- Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825)
- Align with style conventions (grafana/jsonnet-libs#1038)
- Add a function to remove an alert rule (grafana/jsonnet-libs#812)
- mixin-utils: Parameterize interval for histogramRules (grafana/jsonnet-libs#806)
- refactor(grafana/jsonnet-libsprometheus): shard mixins over multiple configmaps (grafana/jsonnet-libs#497)
- Not all Prometheus rules are alerts. (grafana/jsonnet-libs#490)
CharlieTLe added a commit to CharlieTLe/cortex-jsonnet that referenced this pull request Jul 21, 2024
Updates grafana-builder and mixin-utils to latest version in master branch. This will be helpful in creating Grafana panels that use the timeseriesPanel instead of the deprecated panel.

grafana-builder changes:

- grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285)
- More native histograms related utils and renaming (grafana/jsonnet-libs#1270)
- Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150)
- Basic native histogram utilities (grafana/jsonnet-libs#1164)
- grafana-builder: rename template variable "Data Source" to "Data source" (grafana/jsonnet-libs#1111)
- Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825)
- Allow dashboards to show gRPC codes as labels (grafana/jsonnet-libs#1098)
- Allow configuring sort order for variables (grafana/jsonnet-libs#1014)
- remove unused/wrong step param (grafana/jsonnet-libs#999)
- Show cancelled requests in grey on QPS dashboards. (grafana/jsonnet-libs#988)
- Show cancelled requests in yellow on QPS dashboards. (grafana/jsonnet-libs#986)
- Add timeseriesPanel (grafana/jsonnet-libs#824)
- Allow including "All" for single template var
- Allow datasource's regex to be configured
- grafana-builder: make allValue configurable (grafana/jsonnet-libs#703)
- grafana_builder: add dashboard link func (grafana/jsonnet-libs#683)
- Add 'Data Source' label for the default datasource template variable. (grafana/jsonnet-libs#672)
- enable toolip by default (grafana/jsonnet-libs#665)

mixin-utils changes:

- grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285)
- More native histograms related utils and renaming (grafana/jsonnet-libs#1270)
- nativeClassicSumBy: format list of labels nicer (grafana/jsonnet-libs#1204)
- Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150)
- chore: fix hardcoded range interval (grafana/jsonnet-libs#1190)
- Basic native histogram utilities (grafana/jsonnet-libs#1164)
- utils: allow defining native histogram recording rule (grafana/jsonnet-libs#1156)
- modify withRunbookURL to allow internal annotation (grafana/jsonnet-libs#1139)
- mixin-utils: drop unsupported step target parameter (grafana/jsonnet-libs#1128)
- Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825)
- Align with style conventions (grafana/jsonnet-libs#1038)
- Add a function to remove an alert rule (grafana/jsonnet-libs#812)
- mixin-utils: Parameterize interval for histogramRules (grafana/jsonnet-libs#806)
- refactor(grafana/jsonnet-libsprometheus): shard mixins over multiple configmaps (grafana/jsonnet-libs#497)
- Not all Prometheus rules are alerts. (grafana/jsonnet-libs#490)

Signed-off-by: Charlie Le <[email protected]>
CharlieTLe added a commit to CharlieTLe/cortex-jsonnet that referenced this pull request Jul 21, 2024
Updates grafana-builder and mixin-utils to latest version in master branch. This will be helpful in creating Grafana panels that use the timeseriesPanel instead of the deprecated panel.

grafana-builder changes:

- grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285)
- More native histograms related utils and renaming (grafana/jsonnet-libs#1270)
- Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150)
- Basic native histogram utilities (grafana/jsonnet-libs#1164)
- grafana-builder: rename template variable "Data Source" to "Data source" (grafana/jsonnet-libs#1111)
- Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825)
- Allow dashboards to show gRPC codes as labels (grafana/jsonnet-libs#1098)
- Allow configuring sort order for variables (grafana/jsonnet-libs#1014)
- remove unused/wrong step param (grafana/jsonnet-libs#999)
- Show cancelled requests in grey on QPS dashboards. (grafana/jsonnet-libs#988)
- Show cancelled requests in yellow on QPS dashboards. (grafana/jsonnet-libs#986)
- Add timeseriesPanel (grafana/jsonnet-libs#824)
- Allow including "All" for single template var
- Allow datasource's regex to be configured
- grafana-builder: make allValue configurable (grafana/jsonnet-libs#703)
- grafana_builder: add dashboard link func (grafana/jsonnet-libs#683)
- Add 'Data Source' label for the default datasource template variable. (grafana/jsonnet-libs#672)
- enable toolip by default (grafana/jsonnet-libs#665)

mixin-utils changes:

- grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285)
- More native histograms related utils and renaming (grafana/jsonnet-libs#1270)
- nativeClassicSumBy: format list of labels nicer (grafana/jsonnet-libs#1204)
- Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150)
- chore: fix hardcoded range interval (grafana/jsonnet-libs#1190)
- Basic native histogram utilities (grafana/jsonnet-libs#1164)
- utils: allow defining native histogram recording rule (grafana/jsonnet-libs#1156)
- modify withRunbookURL to allow internal annotation (grafana/jsonnet-libs#1139)
- mixin-utils: drop unsupported step target parameter (grafana/jsonnet-libs#1128)
- Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825)
- Align with style conventions (grafana/jsonnet-libs#1038)
- Add a function to remove an alert rule (grafana/jsonnet-libs#812)
- mixin-utils: Parameterize interval for histogramRules (grafana/jsonnet-libs#806)
- refactor(grafana/jsonnet-libsprometheus): shard mixins over multiple configmaps (grafana/jsonnet-libs#497)
- Not all Prometheus rules are alerts. (grafana/jsonnet-libs#490)

Signed-off-by: Charlie Le <[email protected]>
friedrichg pushed a commit to cortexproject/cortex-jsonnet that referenced this pull request Aug 20, 2024
Updates grafana-builder and mixin-utils to latest version in master branch. This will be helpful in creating Grafana panels that use the timeseriesPanel instead of the deprecated panel.

grafana-builder changes:

- grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285)
- More native histograms related utils and renaming (grafana/jsonnet-libs#1270)
- Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150)
- Basic native histogram utilities (grafana/jsonnet-libs#1164)
- grafana-builder: rename template variable "Data Source" to "Data source" (grafana/jsonnet-libs#1111)
- Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825)
- Allow dashboards to show gRPC codes as labels (grafana/jsonnet-libs#1098)
- Allow configuring sort order for variables (grafana/jsonnet-libs#1014)
- remove unused/wrong step param (grafana/jsonnet-libs#999)
- Show cancelled requests in grey on QPS dashboards. (grafana/jsonnet-libs#988)
- Show cancelled requests in yellow on QPS dashboards. (grafana/jsonnet-libs#986)
- Add timeseriesPanel (grafana/jsonnet-libs#824)
- Allow including "All" for single template var
- Allow datasource's regex to be configured
- grafana-builder: make allValue configurable (grafana/jsonnet-libs#703)
- grafana_builder: add dashboard link func (grafana/jsonnet-libs#683)
- Add 'Data Source' label for the default datasource template variable. (grafana/jsonnet-libs#672)
- enable toolip by default (grafana/jsonnet-libs#665)

mixin-utils changes:

- grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285)
- More native histograms related utils and renaming (grafana/jsonnet-libs#1270)
- nativeClassicSumBy: format list of labels nicer (grafana/jsonnet-libs#1204)
- Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150)
- chore: fix hardcoded range interval (grafana/jsonnet-libs#1190)
- Basic native histogram utilities (grafana/jsonnet-libs#1164)
- utils: allow defining native histogram recording rule (grafana/jsonnet-libs#1156)
- modify withRunbookURL to allow internal annotation (grafana/jsonnet-libs#1139)
- mixin-utils: drop unsupported step target parameter (grafana/jsonnet-libs#1128)
- Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825)
- Align with style conventions (grafana/jsonnet-libs#1038)
- Add a function to remove an alert rule (grafana/jsonnet-libs#812)
- mixin-utils: Parameterize interval for histogramRules (grafana/jsonnet-libs#806)
- refactor(grafana/jsonnet-libsprometheus): shard mixins over multiple configmaps (grafana/jsonnet-libs#497)
- Not all Prometheus rules are alerts. (grafana/jsonnet-libs#490)

Signed-off-by: Charlie Le <[email protected]>
friedrichg added a commit to cortexproject/cortex-jsonnet that referenced this pull request Oct 23, 2024
* Update jsonnet-libs to Fri Jul 19 12:51:49 2024

Updates grafana-builder and mixin-utils to latest version in master branch. This will be helpful in creating Grafana panels that use the timeseriesPanel instead of the deprecated panel.

grafana-builder changes:

- grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285)
- More native histograms related utils and renaming (grafana/jsonnet-libs#1270)
- Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150)
- Basic native histogram utilities (grafana/jsonnet-libs#1164)
- grafana-builder: rename template variable "Data Source" to "Data source" (grafana/jsonnet-libs#1111)
- Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825)
- Allow dashboards to show gRPC codes as labels (grafana/jsonnet-libs#1098)
- Allow configuring sort order for variables (grafana/jsonnet-libs#1014)
- remove unused/wrong step param (grafana/jsonnet-libs#999)
- Show cancelled requests in grey on QPS dashboards. (grafana/jsonnet-libs#988)
- Show cancelled requests in yellow on QPS dashboards. (grafana/jsonnet-libs#986)
- Add timeseriesPanel (grafana/jsonnet-libs#824)
- Allow including "All" for single template var
- Allow datasource's regex to be configured
- grafana-builder: make allValue configurable (grafana/jsonnet-libs#703)
- grafana_builder: add dashboard link func (grafana/jsonnet-libs#683)
- Add 'Data Source' label for the default datasource template variable. (grafana/jsonnet-libs#672)
- enable toolip by default (grafana/jsonnet-libs#665)

mixin-utils changes:

- grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285)
- More native histograms related utils and renaming (grafana/jsonnet-libs#1270)
- nativeClassicSumBy: format list of labels nicer (grafana/jsonnet-libs#1204)
- Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150)
- chore: fix hardcoded range interval (grafana/jsonnet-libs#1190)
- Basic native histogram utilities (grafana/jsonnet-libs#1164)
- utils: allow defining native histogram recording rule (grafana/jsonnet-libs#1156)
- modify withRunbookURL to allow internal annotation (grafana/jsonnet-libs#1139)
- mixin-utils: drop unsupported step target parameter (grafana/jsonnet-libs#1128)
- Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825)
- Align with style conventions (grafana/jsonnet-libs#1038)
- Add a function to remove an alert rule (grafana/jsonnet-libs#812)
- mixin-utils: Parameterize interval for histogramRules (grafana/jsonnet-libs#806)
- refactor(grafana/jsonnet-libsprometheus): shard mixins over multiple configmaps (grafana/jsonnet-libs#497)
- Not all Prometheus rules are alerts. (grafana/jsonnet-libs#490)

Signed-off-by: Charlie Le <[email protected]>

* Use `timeseriesPanel` instead of `panel` when creating panels

Fixes: #44
Depends on: #57

Signed-off-by: Charlie Le <[email protected]>

* Add units to timeseries panel

The yaxes field doesn't seem to do anything in the timeseries panel and was replaced with the units field instead. So I defaulted the units to be short and allowed it to be set for the panel.

Signed-off-by: Charlie Le <[email protected]>

* Update CHANGELOG.md

---------

Signed-off-by: Charlie Le <[email protected]>
Co-authored-by: Friedrich Gonzalez <[email protected]>
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.

3 participants