Add Grafana datasources
What you’ll accomplish
Section titled “What you’ll accomplish”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.
Prerequisites
Section titled “Prerequisites”- UDS CLI installed
- Access to a Kubernetes cluster with UDS Core deployed
- URL and any credentials for the external datasource you want to add
Before you begin
Section titled “Before you begin”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.
-
Add a datasource via bundle overrides
Define the new datasource under the
extraDatasourcesvalue on theuds-grafana-configchart in thegrafanacomponent. Each entry follows the Grafana datasource provisioning format.uds-bundle.yaml packages:- name: corerepository: registry.defenseunicorns.com/public/coreref: x.x.x-upstreamoverrides:grafana:uds-grafana-config:values:- path: extraDatasourcesvalue:- name: External Prometheustype: prometheusaccess: proxyurl: http://prometheus.example.com:9090 -
Create and deploy your bundle
Terminal window uds create <path-to-bundle-dir>uds deploy uds-bundle-<name>-<arch>-<version>.tar.zst
Verification
Section titled “Verification”Open Grafana and navigate to Connections > Data sources. Confirm the new datasource appears in the list. Click Test on the datasource to verify connectivity.
# Verify the datasource ConfigMap includes your new entryuds zarf tools kubectl get configmap grafana-datasources -n grafana -o yamlTroubleshooting
Section titled “Troubleshooting”Datasource not appearing in Grafana
Section titled “Datasource not appearing in Grafana”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.
Connection test fails
Section titled “Connection test fails”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.
Related Documentation
Section titled “Related Documentation”- Grafana: Data sources — full list of supported datasource types and configuration options
- Grafana: Provisioning data sources — YAML provisioning format reference
Next steps
Section titled “Next steps”These guides and concepts may be useful to explore next: