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

[RC4] Fix for datadog logs output #196

Merged
merged 3 commits into from
May 29, 2024
Merged

[RC4] Fix for datadog logs output #196

merged 3 commits into from
May 29, 2024

Conversation

jt-dd
Copy link
Contributor

@jt-dd jt-dd commented May 28, 2024

Fix to set the output for the datadog agent:

  • DD_ENV env var needs to be set to activate the json output
  • DD_ENV will set the datadog tags env

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented May 28, 2024

Software Composition Analysis

✅ No library vulnerabilities found (compared ec17feb against 3e3ff1d).

@jt-dd jt-dd marked this pull request as ready for review May 28, 2024 20:08
@jt-dd jt-dd requested a review from a team as a code owner May 28, 2024 20:08
Minosity-VR
Minosity-VR previously approved these changes May 29, 2024
Copy link
Contributor

@Minosity-VR Minosity-VR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!
idk if we want to add a way to have a json logger even for non DD users, I'm wondering if we're not tying KH too much with DD

Copy link
Contributor

@edznux-dd edznux-dd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather have a switch for JSON logging that something indirect based on the env.
I could then be wrapped by the config load for the prod env, but mixing the 2 is not great semantically.

If user want to use json logging, they will have to setup DD_ENV= something, which is weird.

We have a config file, imo that should be put there:
log_format:"json", log_format:"text" seems simple to implement as well.

Comment on lines 20 to 23
func IsDDFormat() bool {
_, isDDEnv := os.LookupEnv("DD_ENV")

return isDDEnv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a huge fan of IsDDFormat here, what format is it? (I know it's for the logs because this PR says it, but it's a global func)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I just reuse what was in place. Did not like the ProdEnv() func. Will see if it is not too painful to add it to the config file instead.

Copy link
Contributor

@edznux-dd edznux-dd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(actually putting this as a request change haha)

@jt-dd jt-dd merged commit 879a968 into main May 29, 2024
7 checks passed
@jt-dd jt-dd deleted the jt-dd/log-fix-rc4 branch May 29, 2024 11:41
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

Successfully merging this pull request may close these issues.

3 participants