-
Notifications
You must be signed in to change notification settings - Fork 435
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
ddtrace/tracer: add startup logging #685
Conversation
4ebaa0a
to
70f153b
Compare
cc6a517
to
6e54158
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 looks good now. Can we document the struct and funcs in log.go
too?
This commit adds a json-formatted log line to tracer startup in order make debugging the tracer easier.
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.
Thanks @knusbaum for the work on this. I left a few comments.
Additionally:
- I am not seeing the json object to be prepended by
DATADOG TRACER CONFIGURATION
. This is useful so both devs here in issues and our solutions team can ask to search in logs for that key phrase and copy/paste the value. - Every check that we do and fails (e.g. agent connectivity) should have an additional line
DATADOG TRACER DIAGNOSTICS
. So, as an example, for the fieldagent_error
if it fails we should have both a message in theagent_error
field (that will be copied an pasted to us) and a unique line in the logs with the same message containing the wordsDATADOG TRACER DIAGNOSTICS
.
Co-authored-by: Gabriel Aszalos <gabriel.aszalos@gmail.com>
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.
I'm not happy with the verboseness of the DATADOG TRACER DIAGNOSTICS
and DATADOG TRACER CONFIGURATION
prefixes.
Instead, I'm just including DIAGNOSTICS
and CONFIGURATION
.
Then the logs will begin:
Datadog Tracer v1.26.0 WARN: DIAGNOSTICS
and
Datadog Tracer v1.26.0 INFO: CONFIGURATION
Does this work, @labbati, @gbbr ?
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 good, but:
- Please add tests for the returned error messages, it would be nice if they would be displayed as:
Error parsing DD_....:
at index 1: ...
at index 4: ...
- The caps are terrible, why are they needed?
- The verbosity of the logs is also not great and seems unnecessary.
Co-authored-by: Gabriel Aszalos <gabriel.aszalos@gmail.com>
…e-go into knusbaum/startup-logging
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 LGTM, but I added another commit to clean up because those tests were looking very copy/pasta-ish. If you're happy with my latest commit, feel free to merge.
Perfect. Your changes look great. |
This commit adds a json-formatted log line and other diagnostic messages to tracer startup in order make debugging the tracer easier.
The merge of DataDog#692 conflicted with tests from DataDog#685, causing failures in ddtrace/tracer/log_test.go There were also tests added in DataDog#685 in ddtrace/tracer/sampler_test.go which fail in go1.14 due to changes in json parsing.
This commit adds a json-formatted log line to tracer startup in order make
debugging the tracer easier.
This is part of an effort that spans all tracers, and should follow the specification.
The basic idea is to collect commonly-needed information as the tracer starts up and report it in one json-formatted log line.