create and replace target:http relation with a new prometheus target interface
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Prometheus2 charm |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
Due to the migration of charms to use interface-
This new interface would need to relay the following information:
- datasource name: comprised of the service name, or the name of the application, and the description, currently set to Juju generated source)
- url: prometheus's URL used to query metrics. For example, in telegraf charm, there's logic around rendering the dashboard template regarding these metrics
With this interface, a provider for interface-
description: | updated |
Thank you for the bug. Could you describe a little more what you would expect (ie. share what a bundle.yaml would look like).
Exported dashboards can have an "__input" key to convert a variable used across the JSON file (ie. "<< datasource >>") to the input shared.
More information can be found at:
* Data source API [1]
* Dashboard API [2]
* Export/Import [3]
* Provisioning (Datasources) [4]
Some questions:
1) What is the expectation in terms of Grafana relations to datasources?
2) Is the goal to have a single datasource (Prometheus) and make any dashboard use such datasource? Or should Grafana be able to relate to multiple datasources and configure dashboards using different datasources?
3) In case of multiple datasources, shouldn't the dashboard JSON file have some information on the type of datasource to use (ie. Prometheus, or Elasticsearch...)?
4) In case of multiple datasources, what if there are multiple of the same type (2 Prometheus datasources)
When grafana relates to prometheus via the grafana-source interface, Grafana already gets information about the datasource (which could be used for any dashboard).
OTOH, the other side of the grafana-dashboard relation could check if it also has a target endpoint available, and share the datasource pointing to that target. However, it could happen that the same prometheus exporter (managing its own dashboards) is related to multiple scrapers (although unlikely and we could state that such approach is not supported).
1. https:/ /grafana. com/docs/ grafana/ latest/ http_api/ data_source/ /grafana. com/docs/ grafana/ latest/ http_api/ dashboard/ /grafana. com/docs/ grafana/ latest/ reference/ export_ import/ /grafana. com/docs/ grafana/ latest/ administration/ provisioning/ #datasources
2. https:/
3. https:/
4. https:/