diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2026-09-02 12:43:22 +0000 |
|---|---|---|
| committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2026-09-02 12:43:22 +0000 |
| commit | b258cee3c1eb09ee8b5536f2fd2dda9e27496d13 (patch) | |
| tree | bea5ce009d8b265d49fd7102b5a0791029b0b37b /src | |
| parent | 611550d23ffbb0a90a9fbe24a17ec2bbbb09458b (diff) | |
| download | vyos-1x-b258cee3c1eb09ee8b5536f2fd2dda9e27496d13.tar.gz vyos-1x-b258cee3c1eb09ee8b5536f2fd2dda9e27496d13.zip | |
T9273: Add Telegraf global_tags option configurable
Adds Telegraf global_tags support - static tags stamped onto every metric.
```
set service monitoring telegraf global-tag <tag-name> value <tag-value>
```
Rendered as a [global_tags] block in telegraf.conf, applied ahead of all outputs.
Diffstat (limited to 'src')
| -rwxr-xr-x | src/conf_mode/service_monitoring_telegraf.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/service_monitoring_telegraf.py b/src/conf_mode/service_monitoring_telegraf.py index 9ce73eaf8..24571aa96 100755 --- a/src/conf_mode/service_monitoring_telegraf.py +++ b/src/conf_mode/service_monitoring_telegraf.py @@ -126,6 +126,12 @@ def verify(monitoring): verify_vrf(monitoring) + # Verify global-tag + if 'global_tag' in monitoring: + for tag, tag_config in monitoring['global_tag'].items(): + if 'value' not in tag_config: + raise ConfigError(f'Global tag "{tag}" has no value assigned!') + # Verify influxdb if 'influxdb' in monitoring: if 'authentication' not in monitoring['influxdb'] or \ |
