Skip to content

[FEATURE] Helm Chart: Add support for enabling metrics endpoint and optional ServiceMonitor #1369

Closed as not planned

Description

@Daniel-Vaz

📋 Prerequisites

📝 Feature Summary

Add Helm values to easily enable the controller metrics endpoint and optionally deploy a Prometheus Operator ServiceMonitor.

❓ Problem Statement / Motivation

The kagent controller already supports exposing a metrics endpoint via the flags:

  • --metrics-bind-address
  • --metrics-secure

These can also be configured via environment variables, for example:

export METRICS_BIND_ADDRESS=":9093"
export METRICS_SECURE="false"

However, the current Helm chart does not provide a simple, documented way to enable and expose this metrics endpoint.

Even if we manually inject environment variables through values like:

controller:
  env:
    - name: "METRICS_BIND_ADDRESS"
      value: ":9093"
    - name: "METRICS_SECURE"
      value: "false"

This is still incomplete because:

  1. The Helm chart does not automatically expose the metrics port in the controller Service.
  2. Users must manually create or modify a Kubernetes Service to reference the new port.
  3. Users must manually create a ServiceMonitor (when using Prometheus Operator) to scrape the endpoint.
  4. There is no single, cohesive way to “enable metrics” through values.yaml.

This makes observability setup more complex than necessary.

💡 Proposed Solution

Introduce Helm values for metrics configuration and optional Prometheus Operator integration.

For example:

metrics:
  enabled: true
  bindAddress: ":9093"
  secure: false

  service:
    enabled: true
    port: 9093
    type: ClusterIP

  serviceMonitor:
    enabled: true
    interval: 60s
    scrapeTimeout: 10s
    labels: {}

🔄 Alternatives Considered

No response

🎯 Affected Service(s)

Controller Service

📚 Additional Context

Many Kubernetes projects provide a built-in metrics and serviceMonitor configuration block in their Helm charts. Adding similar support to kagent would:

  1. Improve user experience
  2. Reduce configuration drift
  3. Encourage consistent observability setups
  4. Make kagent easier to integrate into Prometheus-based monitoring stacks

🙋 Are you willing to contribute?

  • I am willing to submit a PR for this feature

Activity

  1. Daniel-Vaz commented on Feb 25, 2026

    @Daniel-Vaz
    ContributorAuthor

    Related with #130

  2. Daniel-Vaz commented on Feb 26, 2026

    @Daniel-Vaz
    ContributorAuthor

    @EItanya
    I can work on the helm chart changes since that's what I'm most comfortable with.

    Questions:

    • Do you have any concerns or recommendations regarding the proposed solution here (the new metrics block values)?
    • Do deployed agents expose any metrics (or can they be configured to do so) ?
  3. danielorbach commented on May 6, 2026

    @danielorbach
    Contributor

    @Daniel-Vaz / @EItanya do you want to reopen this issue? I believe we have a solution at #1803 .

  4. Daniel-Vaz commented on Jun 5, 2026

    @Daniel-Vaz
    ContributorAuthor

    Currently we have two PR's opened focusing on this subject, but none is getting a response regarding if this is something the project wants to add or not:

    @EItanya when you get a chance could you perhaps shine some light in terms of the direction the project is going regarding controller metrics ?

  5. added a commit that references this issue on Jun 8, 2026
    7fb3aa6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleThis issue or PR has become stale

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions