generated from honeycombio/.github
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 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 - Move config vars into NewConfig - Remove flags.* usage - Add descriptions to Config struct fields - Move stats dataset name from assembler to config - Add stats dataset config option and allow to read from env var - Removes unused config options - max, statsevery, verbose, debug, quiet, fname and tstype - Add config validate func with Missing and Invalid error types - Add GetMaskedAPIKey func to config so we can safely log it - Add tests for key masking - Add env util for retrieving string and bool env vars with a default - Reorganise main.go, includes setup of logging, libhoney and k8s into their own funcs - Update README to include the env vars we currently support - Add test and docker-test makefile targets - Update main and pr github workflows to execute tests using new makefile targets ## 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. --------- Co-authored-by: Robb Kidd <robbkidd@honeycomb.io> Co-authored-by: JamieDanielson <jamieedanielson@gmail.com>
- Loading branch information
1 parent
3f58ecf
commit ef65ddc
Showing
15 changed files
with
374 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
HONEYCOMB_API_KEY=your-api-key | ||
GITHUB_TOKEN=githubusername:githubaccesstoken | ||
BASE64_TOKEN=$(echo -n $GITHUB_TOKEN | base64) | ||
HONEYCOMB_API_ENDPOINT=https://api.honeycomb.io | ||
HONEYCOMB_DATASET=k8s-network-agent | ||
HONEYCOMB_STATS_DATASET=k8s-network-agent-stats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM golang:1.20 as builder | ||
RUN apt update -yq && apt install -yq clang llvm make libpcap-dev | ||
WORKDIR /src | ||
COPY go.* . | ||
RUN go mod download | ||
COPY . . | ||
RUN make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.