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-operator importing grafanaCom dashboards breaks templating #31961

Open
mobidyc opened this issue Feb 17, 2025 · 1 comment
Open

grafana-operator importing grafanaCom dashboards breaks templating #31961

mobidyc opened this issue Feb 17, 2025 · 1 comment
Assignees
Labels
grafana-operator in-progress tech-issues The user has a technical issue about an application

Comments

@mobidyc
Copy link

mobidyc commented Feb 17, 2025

Name and Version

bitnamicharts/grafana-operator 4.9.6

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Deploy the grafana-operator charts.

  2. Deploy a GrafanaDatasource

apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
metadata:
  name: prometheus
  namespace: default
spec:
  instanceSelector:
    matchLabels:
      app.kubernetes.io/instance: grafana-operator
      app.kubernetes.io/managed-by: Helm
      app.kubernetes.io/name: grafana-operator
  datasource:
    name: prometheus
    type: prometheus
    access: proxy
    url: http://kube-prometheus-prometheus:9090
    isDefault: true
    jsonData:
      'tlsSkipVerify': true
      'timeInterval': "5s"
  1. import a dashboard - I tried with or without datasources and a mix of different values with same result:
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
  name: grafana-dashboard-redis-11835
  namespace: default
  labels:
    app: grafana
spec:
  instanceSelector:
    matchLabels:
      app.kubernetes.io/instance: grafana-operator
      app.kubernetes.io/managed-by: Helm
      app.kubernetes.io/name: grafana-operator
  # https://grafana.com/grafana/dashboards/13502-minio-dashboard/
  grafanaCom:
    id: 13502
    revision: 26
  datasources:
    - datasourceName: prometheus
      inputName: prometheus

Are you using any custom parameters or values?

Should not impact the result, but the values.yaml customization are:

operator:
  enabled: true
  prometheus:
    serviceMonitor:
      enabled: true

grafana:
  enabled: true
  config:
    server:
      root_url: "http://grafana-operator-grafana-service:3000/grafana"
      serve_from_sub_path: "true"

What is the expected behavior?

I expect the templating variables to be working

What do you see instead?

The data source is lost in the the templating variables

Additional information

No response

@mobidyc mobidyc added the tech-issues The user has a technical issue about an application label Feb 17, 2025
@github-actions github-actions bot added the triage Triage is needed label Feb 17, 2025
@github-actions github-actions bot removed the triage Triage is needed label Feb 18, 2025
@github-actions github-actions bot assigned juan131 and unassigned carrodher Feb 18, 2025
@juan131
Copy link
Contributor

juan131 commented Feb 18, 2025

Hi @mobidyc

It seems the input name expected by that specific dashboard is DS_PROMETHEUS, see:

As a consequence, you need to apply the change below in your GrafanaDashboard:

apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
  name: grafana-dashboard-redis-11835
  namespace: default
  labels:
    app: grafana
spec:
  instanceSelector:
    matchLabels:
      app.kubernetes.io/instance: grafana-operator
      app.kubernetes.io/managed-by: Helm
      app.kubernetes.io/name: grafana-operator
  # https://grafana.com/grafana/dashboards/13502-minio-dashboard/
  grafanaCom:
    id: 13502
    revision: 26
  datasources:
    - datasourceName: prometheus
-      inputName: prometheus
+      inputName: DS_PROMETHEUS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grafana-operator in-progress tech-issues The user has a technical issue about an application
Projects
None yet
Development

No branches or pull requests

3 participants