-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promtail configuration support for environment variable interpolation not working as documented #3023
Comments
I don't think it's in 2.0.0 see 5793c49 |
It's not. I can verify now that working off of master that it does work if you include the config item that's also not documented. The problem is that the |
Trying to use master, however breaks for us. Something changed in journald scraping that broke what was previously working. We've moved to just templating the file as opposed to working with this feature. |
Yes I'm aware of that, we need a versioned documentation. |
Tell me more about that issue with journald, I made a change there recently. |
scrape_configs:
- job_name: journal
journal:
json: false
max_age: 168h
path: /var/log/journal
labels:
job: systemd-journal
relabel_configs:
- action: replace
source_labels: ['__journal__systemd_unit']
target_label: 'unit'
- job_name: varlogs
ec2_sd_configs:
- profile: arn:aws:iam::<REDACTED>:instance-profile/<REDACTED>
static_configs:
- labels:
job: varlogs
relabel_configs:
- action: replace
replacement: /var/log/**.log
target_label: __path__
- action: labelmap
regex: __meta_ec2_(.+)
- action: replace
source_labels: [__meta_ec2_private_dns_name]
regex: "(.*).ec2.internal"
replacement: $1
target_label: __host__ The above worked for us in version 2.0, but when testing with the master branch journal doesn't even show up |
Any logs from promtail ? |
@shairozan hey, just pass |
i meet the same probleam yet, i will try it, thank you |
in this doc page, already have it |
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Describe the bug
Documentation for promtail on grafana indicates that variable interpolation happens before the config file is read
The above section of the config is for a scrape with EC2 service discovery. SInce we're using service profiles on EC2, it makes sense to just use the instance profile which we can set from the env.
Attempting to start promtail works, but authentication for the SD fails:
is not authorized to perform: sts:AssumeRole on resource: ${INSTANCE_PROFILE_ARN}
Whenever the EC2 authorization happens, it should have already interpolated and read those values from
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The config would have already interpolated the
INSTANCE_PROFILE_ARN
from the environment (or used a null string) per the documentation and not actually just try to use that raw text as the ARN.Environment:
Screenshots, Promtail config, or terminal output
Terminal output
I've dug into the source code for V2 and I don't even see the interpolation happening for any variables. Was this removed in 2.0 and the docs not updated?
At this point Promtail is created and getting ready to be run, but the config still has the interpolation strings, not null values or values from the environment
The text was updated successfully, but these errors were encountered: