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

Extend distributor trace logger with optional features to include span attributes and filter by error status #1465

Merged

Conversation

faustodavid
Copy link
Contributor

@faustodavid faustodavid commented Jun 1, 2022

What this PR does:
Extend distributor trace logger with optional features to include span attributes and filter by error status

This can help to do error correlation analysis by attribute.

Which issue(s) this PR fixes:
Fixes #1485

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

…pan attributes and to filter by status error

Signed-off-by: Fausto David Suarez Rosario <[email protected]>
Signed-off-by: Fausto David Suarez Rosario <[email protected]>
Signed-off-by: Fausto David Suarez Rosario <[email protected]>
@faustodavid
Copy link
Contributor Author

Hey @kvrhdn, in my last draft PR, you mentioned making log_received_traces backward compatible. Do you have an example of how I can parse the YAML optionally as a bool or struct?

Also the name log_received_traces, I think it should be log_received_spans, what do you think?

Signed-off-by: Fausto David Suarez Rosario <[email protected]>
Signed-off-by: Fausto David Suarez Rosario <[email protected]>
Signed-off-by: Fausto David Suarez Rosario <[email protected]>
…butes, update docs

Signed-off-by: Fausto David Suarez Rosario <[email protected]>
@kvrhdn
Copy link
Member

kvrhdn commented Jun 2, 2022

Hey @kvrhdn, in my last draft PR, you mentioned making log_received_traces backward compatible. Do you have an example of how I can parse the YAML optionally as a bool or struct?

Also the name log_received_traces, I think it should be log_received_spans, what do you think?

I think you can do this by implementing the Unmarshaler interface: this gives you more control over how yaml is converted into your Go struct.
That said, I like the idea to switch to log_received_spans: it's more accurate and it avoids the issue of having to be backwards compatible.

Signed-off-by: Fausto David Suarez Rosario <[email protected]>
Signed-off-by: Fausto David Suarez Rosario <[email protected]>
Copy link
Member

@mapno mapno left a comment

Choose a reason for hiding this comment

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

General approach looks good. I left to comments about some code structure. Thanks for the contribution!

modules/distributor/config.go Outdated Show resolved Hide resolved
modules/distributor/distributor.go Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@kvrhdn kvrhdn left a comment

Choose a reason for hiding this comment

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

This looks good to me. Nice work on the tests! Works as expected in my local environment :)

modules/distributor/config.go Outdated Show resolved Hide resolved
faustodavid and others added 2 commits June 5, 2022 17:52
* Update CHANGELOG with deprecated flag

Signed-off-by: Fausto David Suarez Rosario <[email protected]>
Co-authored-by: Koenraad Verheyden <[email protected]>
Copy link
Contributor

@knylander-grafana knylander-grafana left a comment

Choose a reason for hiding this comment

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

Doc updates look good. I fixed a capitalization error on another line.

Copy link
Member

@mapno mapno left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'm in favor of merging when the last two minor threads are closed 👍

* Add warning log when log_received_traces flag is use

Signed-off-by: Fausto David Suarez Rosario <[email protected]>
@faustodavid
Copy link
Contributor Author

faustodavid commented Jun 10, 2022

Hey @mapno @kvrhdn , I have linked an issue to the PR to describe a bit better the intention of this feature. #1485

Copy link
Member

@mapno mapno left a comment

Choose a reason for hiding this comment

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

Great work 😄. Thanks for the contribution!

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.

Enrich log_received_traces with attributes and error filter
4 participants