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

Review logger for OTel components to use json format for agent logs #1263

Closed
aengusrooneygrafana opened this issue Jan 13, 2022 · 1 comment · Fixed by #1272
Closed

Review logger for OTel components to use json format for agent logs #1263

aengusrooneygrafana opened this issue Jan 13, 2022 · 1 comment · Fixed by #1272
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.

Comments

@aengusrooneygrafana
Copy link
Contributor

aengusrooneygrafana commented Jan 13, 2022

When I apply a json format to the agent logs, I get one (annoying) line, that is not json format from OTEL logger -

{"agent":"prometheus","caller":"node.go:85","component":"cluster","level":"info","msg":"applying config","ts":"2022-01-12T15:09:14.625104Z"}
{"agent":"prometheus","caller":"remote.go:180","component":"cluster","level":"info","msg":"not watching the KV, none set","ts":"2022-01-12T15:09:14.625223Z"}
ts=2022-01-12T15:09:14Z level=info caller=traces/traces.go:123 msg="Traces Logger Initialized" component=traces
{"caller":"node_exporter.go:49","integration":"node_exporter","level":"info","msg":"Enabled node_exporter collectors","ts":"2022-01-12T15:09:14.626348Z"} 

We use zap as logger for OTel components, so it should be simple to use a specific formatting (JSON in this case). We instantiate the logger in here https://github.com/grafana/agent/blob/main/pkg/traces/traces.go#L112-L126

@aengusrooneygrafana
Copy link
Contributor Author

@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 22, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant