cozystack/packages/system/monitoring
Andrei Kvapil 23bc8525be
[monitoring] Add inlineScrapeConfig support to tenant vmagent (#2200)
## Summary

- Adds `inlineScrapeConfig` support to the tenant `VMAgent` resource in
`packages/system/monitoring/templates/vm/vmagent.yaml`
- Adds commented usage example in both
`packages/system/monitoring/values.yaml` and
`packages/extra/monitoring/values.yaml`

## Problem

The tenant VMAgent resource does not support custom scrape
configurations. Using `additionalScrapeConfigs` (which references a
Kubernetes Secret) is not viable because tenant users have no access to
create or read Secrets — they can only manage resources under
`apps.cozystack.io`. Instead, `inlineScrapeConfig` accepts inline YAML
directly through Helm values, which is consistent with tenant
permissions.

Relates to #2194

## Usage

```yaml
vmagent:
  inlineScrapeConfig: |
    - job_name: "custom"
      static_configs:
        - targets: ["my-service:9090"]
```

## Test plan

- [ ] `helm template` monitoring with `inlineScrapeConfig` set — block
rendered
- [ ] `helm template` monitoring without it — no `inlineScrapeConfig` in
output
- [ ] Deploy and verify custom scrape targets are picked up by vmagent

```release-note
Add inlineScrapeConfig support to tenant vmagent
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Support for including an inline scrape configuration into VMAgent
monitoring when provided.

* **Documentation**
* Added a commented example showing how to supply an inline scrape job
and targets.
* Reordered remote-write URL entries in monitoring configuration for
clearer ordering.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-16 14:56:15 +01:00
..
charts make cozy-lib as a symbolic link 2026-02-04 03:34:12 +01:00
images move monitoring chart from extra to system package 2026-02-04 03:34:11 +01:00
patches move monitoring chart from extra to system package 2026-02-04 03:34:11 +01:00
templates [monitoring] Add inlineScrapeConfig support to tenant vmagent (#2200) 2026-03-16 14:56:15 +01:00
.helmignore move monitoring chart from extra to system package 2026-02-04 03:34:11 +01:00
Chart.yaml review changes 2026-02-04 03:34:12 +01:00
dashboards-infra.list [monitoring] Scope infrastructure dashboards to tenant-root only 2026-03-10 16:57:24 +01:00
dashboards.list [monitoring] Scope infrastructure dashboards to tenant-root only 2026-03-10 16:57:24 +01:00
Makefile Adding the ability to deploy system monitoring 2026-02-04 03:34:12 +01:00
values.yaml [monitoring] Add inlineScrapeConfig support to tenant vmagent (#2200) 2026-03-16 14:56:15 +01:00