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

Grafana dashboards imported the sidecar with an hardcoded datasource. #744

Closed
pierluigilenoci opened this issue Jan 22, 2021 · 8 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@pierluigilenoci
Copy link

Describe the bug
All the dashboards imported by the sidecar are using "datasource": "default-kubecost".

If you use a custom installation of Grafana and Prometheus, the dashboards cannot be used.

To Reproduce
Install kubecost with a custom Prometheus and Grafana installation and name the Prometheus datasource with something other than default-kubecost.

Expected behavior
Being able to use dashboards in a custom installation.

There are two possibilities:

  1. give the possibility to configure the name of the datasource in the chart
  2. create more general dashboards (best choice)

Tip for the second option: change the datasource in the dashboard in this way "datasource": "${DS_PROMETHEUS}" and add a dropdown list in the templating part like:

"templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "",
          "value": ""
        },
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "DS_PROMETHEUS",
        "options": [],
        "query": "prometheus",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      }
   }
}
@pierluigilenoci pierluigilenoci added the bug Something isn't working label Jan 22, 2021
@AjayTripathy
Copy link
Contributor

Hi @pierluigilenoci there are legacy reasons we do this. We're open to implementing a set of dashboards that use the DS_PROMETHEUS templating, but is a workaround for now just to create a datasource that is called "default-kubecost" in your grafana dashboard?

@pierluigilenoci
Copy link
Author

I've already used this workaround for my PoC with Kubecost but it still remains a dirty trick to get things working.

In my specific case, however, it is not sufficient because I have a single Grafana installation to which all Prometheus installations are connected as datasource. So only one works at a time.

As I said in another ticket, in my opinion, the chart should reward those who update their software compared to those who run legacy versions. In any case, forcing the usage of external workarounds and dirty tricks to make things work does not give a good product image.

Ref: #747 (comment)

@pierluigilenoci
Copy link
Author

@AjayTripathy any update?

@dwbrown2
Copy link
Contributor

@Sean-Holcomb were you going to look at this?

@Sean-Holcomb
Copy link
Contributor

I have updated all of our Grafana templates to include the datasource dropdown that was suggested above. This should be available in the release going out tomorrow.

@dwbrown2
Copy link
Contributor

Fixed in v1.76! Thanks, @Sean-Holcomb.

Let us know if we can get you anything else on this!

@pierluigilenoci
Copy link
Author

pierluigilenoci commented Mar 15, 2021

@dwbrown2 in reality, this is not completely resolved. Now if you have more than one datasource from different Kubecost installations, the dashboard that is opened from the links of the Kubecost UI does not pull up the right datasource that needs to be adjusted by hand. The correct datasource name should be added in the installation and then the parameter added in the UI in this way: &var-datasource=mycustomdatasource

@pierluigilenoci
Copy link
Author

I created this issue as follow up #817

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants