fix: pass prometheus and grafana config as env vars in helm chart - #63
Open
ruslanaliyevn wants to merge 1 commit into
Open
fix: pass prometheus and grafana config as env vars in helm chart#63ruslanaliyevn wants to merge 1 commit into
ruslanaliyevn wants to merge 1 commit into
Conversation
Signed-off-by: Ruslan Aliyev <ruslanaliyevn@email.com>
ruslanaliyevn
force-pushed
the
fix/prometheus-url-helm
branch
from
June 22, 2026 17:14
4c4e5c8 to
a8fa862
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the kagent-tools Helm chart Deployment template to actually wire Prometheus and Grafana configuration values (previously present only in values.yaml) into the running container via environment variables, addressing issue #36.
Changes:
- Add missing Prometheus and Grafana environment variables to
helm/kagent-tools/templates/deployment.yaml. - Minor template cleanup/formatting adjustments in the same manifest.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+97
to
+98
| - name: PROMETHEUS_URL | ||
| value: {{ .Values.tools.prometheus.url | quote }} |
Comment on lines
+99
to
+102
| - name: PROMETHEUS_USERNAME | ||
| value: {{ .Values.tools.prometheus.username | quote }} | ||
| - name: PROMETHEUS_PASSWORD | ||
| value: {{ .Values.tools.prometheus.password | quote }} |
Comment on lines
+101
to
+106
| - name: PROMETHEUS_PASSWORD | ||
| value: {{ .Values.tools.prometheus.password | quote }} | ||
| - name: GRAFANA_URL | ||
| value: {{ .Values.tools.grafana.url | quote }} | ||
| - name: GRAFANA_API_KEY | ||
| value: {{ .Values.tools.grafana.apiKey | quote }} |
Comment on lines
+97
to
+106
| - name: PROMETHEUS_URL | ||
| value: {{ .Values.tools.prometheus.url | quote }} | ||
| - name: PROMETHEUS_USERNAME | ||
| value: {{ .Values.tools.prometheus.username | quote }} | ||
| - name: PROMETHEUS_PASSWORD | ||
| value: {{ .Values.tools.prometheus.password | quote }} | ||
| - name: GRAFANA_URL | ||
| value: {{ .Values.tools.grafana.url | quote }} | ||
| - name: GRAFANA_API_KEY | ||
| value: {{ .Values.tools.grafana.apiKey | quote }} |
dimetron
self-requested a review
June 23, 2026 14:41
jedi-tal
added a commit
to jedi-tal/tools
that referenced
this pull request
Aug 14, 2026
`PROMETHEUS_URL` is documented in the README ("Default Prometheus server
URL") but was never read: every prometheus_* handler hard-coded
`http://localhost:9090` as the fallback for the optional `prometheus_url`
parameter, and the Helm chart's `tools.prometheus.url` value was never
passed to the container (kagent-dev#63, kagent-dev#36).
The practical effect is that the ONLY way to reach a Prometheus that is
not on localhost is for the model to pass `prometheus_url` on every single
call. Because the parameter is optional and the schema advertises a
plausible-looking default, models routinely omit it - the call then fails
with "connection refused" against a port nothing serves inside the tool
server's pod, and the agent burns a turn retrying. On one of our scheduled
survey agents this wasted 12 of a 24-call budget in a single run.
- read `PROMETHEUS_URL` (trimmed) as the default, falling back to
`http://localhost:9090` when unset, so existing deployments are unchanged
- build the `prometheus_url` parameter description from that same value, so
the tool schema advertises the default a caller will actually get instead
of always claiming localhost
- render `PROMETHEUS_URL` in the chart from `tools.prometheus.url`, only
when set; its previous default was schemeless
(`prometheus.kagent.svc.cluster.local:9090`) and would have been rejected
by `security.ValidateURL`, so it now defaults to empty = tool default
The explicit `prometheus_url` parameter still wins when supplied.
Closes kagent-dev#63
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: jedi-tal <tal@jedify.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tools.prometheus.url,tools.prometheus.username,tools.prometheus.password,tools.grafana.urlandtools.grafana.apiKeyvalues were defined invalues.yamlbut never passed to the container as environment variables in
deployment.yaml.Solution
Added the missing environment variables to the deployment template so that
Prometheus and Grafana configuration is properly passed to the tool server.
Fixes #36