Skip to content
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

Environment variables are not getting resolved when passing config through SSM #808

Closed
anilgvpcoe opened this issue Dec 15, 2021 · 4 comments

Comments

@anilgvpcoe
Copy link

Describe the question
We are using aws distro sidecar for our ECS tasks. Based on config-through-ssm we configured a secret and are passing the config to AWS distro, this works fine when config has actual values as below

receivers:
    otlp:
      protocols:
          grpc:
          http:
    prometheus:
      config:
        scrape_configs:
          - job_name: 'local-spring-boot-actuator'
            metrics_path: '/<service-name>/mgmt/prometheus'

However in our case we want to use env variables instead of hardcoding values in config. So we updated config to

receivers:
    otlp:
      protocols:
          grpc:
          http:
    prometheus:
      config:
        scrape_configs:
          - job_name: 'local-spring-boot-actuator'
            metrics_path: '/${SERVICE_NAME}/mgmt/prometheus'

and added SERVICE_NAME env variable in container. Now when aws-distro starts it is unable to reach the same destination we keep getting connect exception in logs.

Is this expected and are there sample configs we can refer to for using env variables in config file

Steps to reproduce if your question is related to an action
Add some env variables in ECS task container. Use the env variables in a config file and load the config file through SSM or secret. Check if env variables are resolving to actual values at runtime.

What did you expect to see?
ENV variables should be resolved to actual values as mentioned here

Environment

  • ECS task with aws-distro as a sidecar container
  • Config is being loaded via AOT_CONFIG_CONTENT pointing to a secret

Additional context
Please let me know if you need more info

@jefchien
Copy link
Member

jefchien commented Dec 15, 2021

Hi @anilgvpcoe,

This is a known issue and a fix was made in #774. Two patches are being released (v0.14.2 and v0.15.1) today to fix this. I will let you know when it is available.

@jefchien
Copy link
Member

We've released v0.14.2 and v0.15.1 (latest). Please use one of these releases.

@anilgvpcoe
Copy link
Author

Awesome thank you so much for quick response @jefchien 🙏 , I will try v0.15.1

@anilgvpcoe
Copy link
Author

thank you, can confirm this is working with 0.15.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants