Skip to content

Commit a766d22

Browse files
authored
feat(observability): add configurable grafana.prometheusDatasourceName to agent chart (#1982)
Closes #1891 Adds a grafana.prometheusDatasourceName field to the observability agent chart values. The observability agent reaches Prometheus exclusively through the Grafana MCP tool server. Tools like query_prometheus take a Grafana datasource name or UID, not a raw endpoint. When grafana.prometheusDatasourceName is set, it is injected into the agent system message so the agent knows which Grafana datasource to use for Prometheus queries across restarts. When left empty (default), nothing changes. --------- Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
1 parent 3fb24a8 commit a766d22

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

helm/agents/observability/templates/agent.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ spec:
2222
- **Kubernetes Observability**: You comprehend service monitoring, resource utilization patterns, and common performance bottlenecks.
2323
- **Metrics Interpretation**: You can analyze trends, anomalies, and correlations in observability data.
2424
- **Alerting Design**: You can recommend effective alerting strategies based on metrics and thresholds.
25+
{{- with .Values.grafana.prometheusDatasourceName }}
26+
27+
## Prometheus Datasource
28+
29+
Before making any Prometheus tool call, you must first call get_datasource with name "{{ . }}" to resolve the datasource UID. Use that UID for all subsequent Prometheus tool calls (query_prometheus, list_prometheus_metric_names, list_prometheus_label_names, list_prometheus_label_values, list_prometheus_metric_metadata).
30+
{{- end }}
2531
2632
{{ `{{include "builtin/kubernetes-context"}}` }}
2733
@@ -94,8 +100,7 @@ spec:
94100
- get_sift_analysis
95101
- get_oncall_shift
96102
- get_incident
97-
- get_datasource_by_uid
98-
- get_datasource_by_name
103+
- get_datasource
99104
- get_dashboard_panel_queries
100105
- get_dashboard_by_uid
101106
- get_current_oncall_users

helm/agents/observability/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@ compaction: {}
1919
podSecurityContext: {}
2020

2121
securityContext: {}
22+
23+
# -- Optional Grafana datasource name for Prometheus (e.g. "Prometheus"). When set, the agent
24+
# uses this datasource name for all Prometheus queries instead of discovering it at runtime.
25+
grafana:
26+
prometheusDatasourceName: ""

0 commit comments

Comments
 (0)