Comments (4)
Dear Alain,
thanks for writing in. Let's see what we can do here.
[I am aiming to discover] the list of unique label names which are reference across all graphs which are using a Prometheus datasource?
I understand the part "using a Prometheus datasource", which is usually referring to "dashboard" entities, right? What do you mean with "unique label names which are reference across all graphs"?
Are you just aiming to discover all panels which use a Prometheus datasource? You can find this snippet within the example invocations listed by grafana-wtf --help
, maybe it will help you already?
# Display all dashboards using data sources with a specific type. Here: InfluxDB.
grafana-wtf explore dashboards --format=json | jq 'select( .[] | .datasources | .[].type=="influxdb" )'
With kind regards,
Andreas.
from grafana-wtf.
Dear Alain,
did you have a chance to evaluate my suggestion, and if that would help you already?
With kind regards,
Andreas.
from grafana-wtf.
Dear Alain,
[I am aiming to discover] the list of unique label names which are reference across all graphs which are using a Prometheus datasource?
I understand the part "using a Prometheus datasource", which is usually referring to "dashboard" entities, right? What do you mean with "unique label names which are reference across all graphs"?
I understand now that you are probably referring to labels stored in Prometheus, right?
With panodata/grafana-client#20, and recent progress in this area through panodata/grafana-client#112, grafana-client gains possibilities to inquire the databases linked into Grafana on behalf of datasource items.
In this spirit, grafana-wtf
could inquire Prometheus for all the labels used over there, and Grafana for all the labels used over here, and then present them side-by-side, or differently.
Would that fit your needs somehow, or can you elaborate what you would like this program to do, beyond what grafana-wtf find
may already be capable of?
With kind regards,
Andreas.
from grafana-wtf.
Iteration +1
We collected a few Grafana Prometheus query expression samples from dashboards at https://play.grafana.org/, and from Prometheus instances run by friends, in order to learn about that the expr
attribute is relevant here, which includes the PromQL query expression.
For extracting the label names from a PromQL query expression, we have been successful using the promql-parser package.
Iteration +2
For inquiring Prometheus about existing label-names and -values, in order to match them against the labels used in Grafana, we discovered corresponding HTTP API endpoints.
Thoughts
A corresponding feature of grafana-wtf
would probably need to list labels grouped by datasource, because distinct Prometheus instances may use completely different sets of labels, right? In this manner, it might not be advisable to throw all available Prometheus labels into the same basket.
/cc @WalBeh
from grafana-wtf.
Related Issues (20)
- Checking for permissions of users and teams HOT 4
- jq syntax is wrong HOT 5
- Alerts: replace datasource HOT 1
- Unexpected keyword argument 'datasource' HOT 8
- Database is locked in thread ... error HOT 17
- Doesn't work for simplest example HOT 10
- find command | return the relevant panel HOT 2
- Grafana 8.4.3 + grafana-wtf 0.13.1 -> "TypeError: '<' not supported between instances of 'dict' and 'dict'" HOT 3
- Unable to explore dashboards on Grafana 8.5.5 HOT 7
- Error "unable to open database file" HOT 8
- Datasources defined as variables listed as unused HOT 6
- Direct panel/variable editor URLs in the output of "find" HOT 6
- CI croaks on Python 3.12.0a3 HOT 3
- Allow replace command to have dry run option HOT 6
- TypeError: unhashable type: 'list' in collect_datasource_items HOT 6
- [Bug] AttributeError: 'Munch' object has no attribute 'title' HOT 4
- Datasources Not in Use HOT 10
- Grep through notification channel(s) HOT 9
- Find MetricName used by Datasource HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grafana-wtf.