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

Make use of standard opentracing tags #43

Open
dadrus opened this issue Jun 7, 2021 · 1 comment
Open

Make use of standard opentracing tags #43

dadrus opened this issue Jun 7, 2021 · 1 comment

Comments

@dadrus
Copy link

dadrus commented Jun 7, 2021

The Opentracing sematic conventions document "standardizes" some tags for different purposes, many APM implementations rely on these to properly display traces & spans.

Unfortunately this project does not make use of these. My proposal is to change this:)

This would mean e.g. in addtion or instead of having

span := c.GetSpan(ctx).NewChild(OpSQLTxBegin)
span.SetLabel("component", "database/sql")

one would have

span := c.GetSpan(ctx).NewChild(OpSQLTxBegin)
span.SetLabel("component", "luna-duclos")
span.SetLabel("db.type", "sql")

in all relevant places. Actually the component tag should be set by a calling app, so it should be configurable. In addition all places with

span.SetLabel("query", query)
if !c.OmitArgs {
    span.SetLabel("args", formatArgs(args))
}

would be changed to

span.SetLabel("db.statement", query)
if !c.OmitArgs {
    span.SetLabel("args", formatArgs(args))
}

Last, but not least, db.instance tag should be set as well.

If backwards compatibility is required, it could be achieved by the introduction of additional options. If you like I can create a PR.

@mellester
Copy link

Nice job @dadrus ill make use of your fork and keep track of erros

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

No branches or pull requests

2 participants