replace_instance_label
does not take effect on custom scrape_configs
#3658
Replies: 5 comments 1 reply
-
Hey there 👋 Just to make sure we're on the same page, the For both metrics and logs, the behavior around the If what you're trying to achieve is to replace the |
Beta Was this translation helpful? Give feedback.
-
The other alternative would be to make use of Flow mode which exposes the hostname as We don't have the tooling for automatically translating from YAML -> River config files yet, but if your config is not terribly big, making the transition shouldn't be too hard! |
Beta Was this translation helpful? Give feedback.
-
I think that's the best way to go, as much as I love my config in yaml... It's a shame there is no such option in the yaml based config without using the environment variable. The config itself is pretty basic, at least the file that gets centrally distributed... Snowflake installations are manually configured as each has different needs or by Ansible and I just inject the right label there but the ultimate goal is to have the config from one central place. Thanks for your comments |
Beta Was this translation helpful? Give feedback.
-
how are you setting via env var? I am troubleshooting a issue where var is unset I am setting the env from systemd service, tried 2 different ways (daemon-reload and service restart after each change)
grafana agent excerpt
example: |
Beta Was this translation helpful? Give feedback.
-
coincidentally just saw there is a -config.expand-env option |
Beta Was this translation helpful? Give feedback.
-
Hi guys
I've been wanting to utilize the feature
replace_instance_label
which is enabled by default; however, in my setup, the instance label is not replaced.A very simple example is when trying to use a vscode exporter extension with the following sample config:
I'm aware that it seems the
replace_instance_label
feature is scoped to integrations but I'm not seeing a way to add a custom scrape target via integrations.Am I missing something?
P.S. Is there such feature for logs? I'd like to use a file target job to collect files from a local system and send to loki; however, I don't see a way to inject the hostname into a label without using environment variable based labels which requires an extra agent flag which can't be easily enabled via the bundled agent installer for Windows.
Perhaps an agent global setting to replace any instance of 127.0.0.1/localhost with actual host name could be introduced?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions