Skip to content

Add Grafana datasources

Connect Grafana to additional data sources beyond the defaults that ship with UDS Core. This is useful when your workloads depend on external metrics stores, tracing backends, or secondary log aggregators that Grafana needs to query alongside the built-in stack.

  • UDS CLI installed
  • Access to a Kubernetes cluster with UDS Core deployed
  • URL and any credentials for the external datasource you want to add

UDS Core configures Grafana with three datasources by default: Prometheus (metrics), Loki (logs), and Alertmanager (alerts). Use this guide when you need to connect Grafana to additional datasources — for example, an external Prometheus instance, Tempo for distributed tracing, or a second Loki deployment.

The extraDatasources value injects entries into the existing grafana-datasources ConfigMap that UDS Core manages. This keeps your configuration declarative and avoids needing to replace the entire ConfigMap.

  1. Add a datasource via bundle overrides

    Define the new datasource under the extraDatasources value on the uds-grafana-config chart in the grafana component. Each entry follows the Grafana datasource provisioning format.

    uds-bundle.yaml
    packages:
    - name: core
    repository: registry.defenseunicorns.com/public/core
    ref: x.x.x-upstream
    overrides:
    grafana:
    uds-grafana-config:
    values:
    - path: extraDatasources
    value:
    - name: External Prometheus
    type: prometheus
    access: proxy
    url: http://prometheus.example.com:9090
  2. Create and deploy your bundle

    Terminal window
    uds create <path-to-bundle-dir>
    uds deploy uds-bundle-<name>-<arch>-<version>.tar.zst

Open Grafana and navigate to Connections > Data sources. Confirm the new datasource appears in the list. Click Test on the datasource to verify connectivity.

Terminal window
# Verify the datasource ConfigMap includes your new entry
uds zarf tools kubectl get configmap grafana-datasources -n grafana -o yaml

Symptom: The new datasource does not show up in the Grafana data sources list after deployment.

Solution: Verify the bundle override path is correct: grafana component, uds-grafana-config chart, extraDatasources value. Redeploy the bundle and confirm the grafana-datasources ConfigMap in the grafana namespace contains your entry.

Symptom: The datasource appears in Grafana but returns an error when you click Test.

Solution: Verify the URL is reachable from within the cluster. Check that network policies allow egress from the grafana namespace to the datasource endpoint.

These guides and concepts may be useful to explore next: