-
Notifications
You must be signed in to change notification settings - Fork 1
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
maint: Refactor Config #197
Conversation
Probably don't ship this.
…to team.queue-stats # Conflicts: # assemblers/tcp_assembler.go # assemblers/tcp_stream.go # assemblers/tcp_stream_factory.go # config/config.go
Co-authored-by: Robb Kidd <robbkidd@honeycomb.io>
Co-authored-by: Robb Kidd <robbkidd@honeycomb.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get the env-var lookups working, I think we'll need to refactor further to remove the flag.* usage in favor of doing more in the NewConfig constructor or wrap the var x = flag.*
statements in an init() {}
function.
…to team.queue-stats # Conflicts: # go.mod
fcf578e
to
4c3c99d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks Mike! I updated these environment variables in my .env
file and updated my deployment.yaml
and confirmed the updated values.
# .env
HONEYCOMB_API_KEY=<redacted>
HONEYCOMB_DATASET=jamie-agent
HONEYCOMB_STATS_DATASET=jamie-agent-stats
...
# deployment.yaml
- name: HONEYCOMB_DATASET
value: $HONEYCOMB_DATASET
- name: HONEYCOMB_STATS_DATASET
value: $HONEYCOMB_STATS_DATASET
2023-09-19 11:20:31 3:20PM INF Starting Honeycomb Network Agent agent_version=0.0.16-alpha api_key=******************1234 dataset=jamie-agent endpoint=https://api.honeycomb.io stats_dataset=jamie-agent-stats
otherwise it will work off a default config and not accept the incoming configured debug address Co-authored-by: Robb Kidd <robbkidd@honeycomb.io>
Co-authored-by: Robb Kidd <robbkidd@honeycomb.io>
Co-authored-by: Robb Kidd <robbkidd@honeycomb.io>
Updated the debug service start in main to use the computed config object , realized that was missing in testing with my environment variable testing. Also added a few clarifications and changes to the deployment yamls! Think this should be good to go now! |
Which problem is this PR solving?
Config options were scattered through the codebase. This PR centralises all configuration options into the Config package and updates usage to be consistent.
Short description of the changes
How to verify that this has the expected result
Config usage is much cleaner and easier to reason about.
Environment variables set in the k8s deployment are used when configuring the agent. For example, you can set
HONEYCOMB_DATASET=some-other-place
under env.