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

[trace] Add logging support to opentracing plugins #8289

Merged
merged 2 commits into from
Jun 18, 2021

Conversation

ajm188
Copy link
Contributor

@ajm188 ajm188 commented Jun 8, 2021

Description

This PR adds a new flag to package trace to initialize the opentracing tracer (either jaeger or datadog) with a logger attached. I've also introduced a struct that implements both jaeger's and datadog's logger interfaces using the go/vt/log package under the hood.

Demo

jaeger + JAEGER_REPORTER_LOG_SPANS=true + -tracing-enable-logging
I0608 12:08:21.671954       8 logger.go:32] Reporting span xxxxxxxxxxxxxxxx:aaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbb:1
I0608 12:08:21.671978       8 logger.go:32] Reporting span xxxxxxxxxxxxxxxx:bbbbbbbbbbbbbbbb:cccccccccccccccc:1
I0608 12:08:21.672031       8 logger.go:32] Reporting span xxxxxxxxxxxxxxxx:dddddddddddddddd:eeeeeeeeeeeeeeee:1
I0608 12:08:21.765381       8 logger.go:32] Reporting span xxxxxxxxxxxxxxxx:ffffffffffffffff:gggggggggggggggg:1
I0608 12:08:21.765405       8 logger.go:32] Reporting span xxxxxxxxxxxxxxxx:gggggggggggggggg:eeeeeeeeeeeeeeee:1
I0608 12:08:21.864331       8 logger.go:32] Reporting span xxxxxxxxxxxxxxxx:hhhhhhhhhhhhhhhh:yyyyyyyyyyyyyyyy:1
I0608 12:08:21.864354       8 logger.go:32] Reporting span xxxxxxxxxxxxxxxx:yyyyyyyyyyyyyyyy:eeeeeeeeeeeeeeee:1
I0608 12:08:21.864369       8 logger.go:32] Reporting span xxxxxxxxxxxxxxxx:eeeeeeeeeeeeeeee:cccccccccccccccc:1
I0608 12:08:21.864388       8 logger.go:32] Reporting span xxxxxxxxxxxxxxxx:cccccccccccccccc:xxxxxxxxxxxxxxxx:1
I0608 12:08:21.913089       8 logger.go:32] Reporting span xxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxx:0:1

Related Issue(s)

Closes #8288

Checklist

  • Tests were added or are not required - n/a
  • Documentation was added or is not required

Deployment Notes

…e standard logging infrastructure

Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
@ajm188 ajm188 added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: Observability Pull requests that touch tracing/metrics/monitoring labels Jun 8, 2021
@ajm188 ajm188 requested a review from systay June 8, 2021 18:23
@ajm188 ajm188 requested a review from doeg as a code owner June 8, 2021 18:23
Copy link
Contributor

@doeg doeg left a comment

Choose a reason for hiding this comment

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

Caveat that I'm familiar with neither Jaeger nor Datadog, but this looks good to me!

@ajm188 ajm188 merged commit 0ff5ccc into vitessio:main Jun 18, 2021
@ajm188 ajm188 deleted the am_trace_logging branch June 18, 2021 15:40
ajm188 added a commit to tinyspeck/vitess that referenced this pull request Jul 23, 2021
[trace] Add logging support to opentracing plugins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Observability Pull requests that touch tracing/metrics/monitoring Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add optional to enable logging in tracing plugins
2 participants