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

support environment variable expansion in log config #337

Open
wasim-nihal opened this issue Mar 21, 2024 · 4 comments
Open

support environment variable expansion in log config #337

wasim-nihal opened this issue Mar 21, 2024 · 4 comments
Labels
enhancement New feature or request python Pull requests that update Python code

Comments

@wasim-nihal
Copy link
Contributor

we have a use case where we spin up 3 different kiwigrid k8s-sidecars. And each of this sidecar has its own log config mounted as a config map. It would be better if there is a feature in kiwigrid-k8s sidecar to expand environment variables and populate the log config at the startup. This would enable users to have only only log config for multiple k8s sidecars and the values can be configurable via environment variables.

Example:
The expansion can happen based on a specific placeholder in the log config (To instance $(<some_env_variable>).

The user can configure the log config in the below way:

version: 1
disable_existing_loggers: false

root:
    level: $(LOG_LEVEL)
    handlers: [console]

And in different sidecars, the value of the environment variable can be different according to needs.

Note: This feature will not be limited to LOG_LEVEL. It shall be generic enough to look up any environment variable enclosed within the placeholder $().

wasim-nihal added a commit to nokia/kiwigrid-k8s-sidecar that referenced this issue Mar 25, 2024
@ChristianGeie
Copy link
Collaborator

Hi @wasim-nihal thx for contributing. Unfortunately, I only now had time to look at your PR. Looks good to me. Can you add a scenario to the existing tests that represents your added functionality?

@ChristianGeie ChristianGeie added enhancement New feature or request python Pull requests that update Python code labels Sep 16, 2024
@wasim-nihal
Copy link
Contributor Author

wasim-nihal commented Sep 25, 2024

Hi @wasim-nihal thx for contributing. Unfortunately, I only now had time to look at your PR. Looks good to me. Can you add a scenario to the existing tests that represents your added functionality?

Hello @ChristianGeie , thanks for taking a look. I have added the test for this feature. Could you please review this? #344

Copy link

This issue has been automatically marked as stale because it has not had any activity in the last 60 days. Thank you for your contributions.

@github-actions github-actions bot added the stale close issues and PRs after 60 days of inactivity label Nov 27, 2024
@wasim-nihal
Copy link
Contributor Author

This issue has been automatically marked as stale because it has not had any activity in the last 60 days. Thank you for your contributions.

commenting to remove stale marker

@github-actions github-actions bot removed the stale close issues and PRs after 60 days of inactivity label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

2 participants