Code Monkey home page Code Monkey logo

Comments (4)

amotl avatar amotl commented on May 18, 2024

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.

amotl avatar amotl commented on May 18, 2024

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.

amotl avatar amotl commented on May 18, 2024

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.

amotl avatar amotl commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.