Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Create Stat Panel, Update Gauge Panel #242

Merged
merged 21 commits into from
Jul 27, 2020
Merged

Create Stat Panel, Update Gauge Panel #242

merged 21 commits into from
Jul 27, 2020

Conversation

trotttrotttrott
Copy link
Member

Stat and gauge are modeled very similarly so I put them together in this PR.

I've tested them with both Grafana 7.0.5 (latest release) and 6.7.4 (latest release of major version 6). These can be selected by passing the pluginVersion parameter to either panel. Grafana version support was the biggest challenge this PR attempts to address. While Grafana does a good job of adapting older JSON models to current versions, we'd like to keep how we model them Grafonnet current so we can support new features.

Closes #237.

Closes #221. This PR was cherry picked to get started on the gauge panel updates.

@trotttrotttrott trotttrotttrott merged commit b773b1a into master Jul 27, 2020
@trotttrotttrott trotttrotttrott deleted the stat-panel branch July 27, 2020 21:03
@fty4
Copy link

fty4 commented Jul 29, 2020

Is there any option to specify width / length of the new gauge panel?

In the old gauge there was a option to set span and height.

@trotttrotttrott
Copy link
Member Author

@fty4 it's intended that gridPos is used.

grafana.gaugePanel.new(
  'Example'
) {
  gridPos: { h: 6, w: 8, x: 0, y: 0 }
}

This field has been used for layout since version 5. However, Grafana will convert the height and span fields when dashboards are loaded. I think I had it in mind that we'd be retiring span and height, but perhaps that's not the right move. I'll create an issue to discuss.

In the meantime, you can add them like in the gridPos example:

grafana.gaugePanel.new(
  'Example'
) {
  height: ...,
  span: ...,
}

@corentinaltepe corentinaltepe mentioned this pull request Aug 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Stat Panel
4 participants