Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions go/core/internal/httpserver/handlers/substrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/kagent-dev/kagent/go/core/internal/httpserver/errors"
"github.com/kagent-dev/kagent/go/core/pkg/auth"
"github.com/kagent-dev/kagent/go/core/pkg/sandboxbackend/substrate"
"k8s.io/apimachinery/pkg/api/meta"
utilvalidation "k8s.io/apimachinery/pkg/util/validation"
"sigs.k8s.io/controller-runtime/pkg/client"
ctrllog "sigs.k8s.io/controller-runtime/pkg/log"
Expand Down Expand Up @@ -110,10 +111,16 @@ func (h *SubstrateHandler) listSubstrateCRs(ctx context.Context, namespace strin

wpList := &atev1alpha1.WorkerPoolList{}
if err := h.KubeClient.List(ctx, wpList, listOpts...); err != nil {
if meta.IsNoMatchError(err) {
return nil, nil, nil
}
return nil, nil, err
Comment on lines 113 to 117
}
tmplList := &atev1alpha1.ActorTemplateList{}
if err := h.KubeClient.List(ctx, tmplList, listOpts...); err != nil {
if meta.IsNoMatchError(err) {
return nil, nil, nil
}
return nil, nil, err
}
Comment on lines 112 to 125

Expand Down
9 changes: 7 additions & 2 deletions helm/agents/observability/templates/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ spec:
- **Kubernetes Observability**: You comprehend service monitoring, resource utilization patterns, and common performance bottlenecks.
- **Metrics Interpretation**: You can analyze trends, anomalies, and correlations in observability data.
- **Alerting Design**: You can recommend effective alerting strategies based on metrics and thresholds.
{{- with .Values.grafana }}{{- if .prometheusDatasourceName }}

## Prometheus Datasource

Before making any Prometheus tool call, you must first call get_datasource with name "{{ .prometheusDatasourceName }}" 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).
Comment on lines +25 to +29
{{- end }}{{- end }}

{{ `{{include "builtin/kubernetes-context"}}` }}

Expand Down Expand Up @@ -94,8 +100,7 @@ spec:
- get_sift_analysis
- get_oncall_shift
- get_incident
- get_datasource_by_uid
- get_datasource_by_name
- get_datasource
- get_dashboard_panel_queries
- get_dashboard_by_uid
- get_current_oncall_users
Expand Down
5 changes: 5 additions & 0 deletions helm/agents/observability/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ resources:
memory: 1Gi

compaction: {}

# -- Optional Grafana datasource name for Prometheus (e.g. "Prometheus"). When set, the agent
# uses this datasource name for all Prometheus queries instead of discovering it at runtime.
grafana:
prometheusDatasourceName: ""
Loading