Skip to content

Support Datasource (uid) as variable value for other Datasource #2215

@genofire

Description

@genofire

Is your feature request related to a problem? Please describe.
I like to link the datasource prometheus to a datasource tempo.
e.g. https://grafana.com/docs/grafana/latest/datasources/tempo/configure-tempo-data-source/

(If applicable)If your feature request solves a bug please provide a link to the community issue

Describe the solution you'd like

---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
metadata:
  name: tempo
spec:
  valuesFrom:
    - targetPath: "jsonData.tracesToMetrics.datasourceUid"
      valueFrom:
        datasourceRef:
          name: prom
          fieldPath: metadata.uid
    - targetPath: "jsonData.serviceMap.datasourceUid"
      valueFrom:
        datasourceRef:
          name: prom
          fieldPath: metadata.uid
  instanceSelector:
    matchLabels:
      dashboards: "grafana"
  datasource:
    name: Tempo
    type: tempo
    url: http://localhost:3200
    access: proxy
    basicAuth: false
    jsonData:
      tracesToMetrics:
        datasourceUid: 'replaced-by-valueFrom'
      serviceMap:
        datasourceUid: 'replaced-by-valueFrom'

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Existing solutions
If applicable please provide a link to an existing solution from a different project

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/needs-informationIndicates an issue needs more information in order to work on it.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions