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

Managing agent configuration #6

Open
amitava82 opened this issue Jan 30, 2025 · 0 comments
Open

Managing agent configuration #6

amitava82 opened this issue Jan 30, 2025 · 0 comments
Assignees

Comments

@amitava82
Copy link
Member

There can be 3 ways configurations can be passed to agent.

  1. via env variables.
  2. via command line arguments.
  3. via a configuration file named agent-conf.yaml. This file can be placed next to agent binary.
# Possible env variable and corresponding config are (more to be added later)
KM_API_KEY # --api-key
KM_COLLECTOR_ENDPOINT # --collector-endpoint
KM_CONFIG_CHECK_INTERVAL # --config-check-interval

When agent runs as service (Linux/Windows) it takes the config file as parameter km-agent start --config="./agent-conf.yaml"

How config file is generated

When user start with agent installation, the command will have few env variables preset. For example:

KM_API_KEY="<API_KEY>" KM_COLLECTOR_ENDPOINT="https://otel.kloudmate.com:8443" bash -c "$(curl -L https://cdn.kloudmate.com/scripts/linux-agent.sh)"

Windows/Linux

The installation process should write the configuration yaml file with the env variable inputs.

Docker/k8s

In case of container environment, the installation script starts the agent container by passing env variables.

Reading config

When agent boots up, it'll read the config file and load them into env. This way we can use env parameter in collector config without hard coding anything into collector config. command line arguments take priority over config file. If user ever has to change config, they can simply edit the agent-conf.yaml.

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