-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[exporter/debug] format spans as one-liners in normal
verbosity
#10280
[exporter/debug] format spans as one-liners in normal
verbosity
#10280
Conversation
This is an initial barebones implementation that only outputs the span's name, trace ID and span ID. Other useful fields like duration etc. can be added in follow-up enhancements.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10280 +/- ##
==========================================
+ Coverage 92.36% 92.46% +0.09%
==========================================
Files 387 390 +3
Lines 18435 18461 +26
==========================================
+ Hits 17028 17070 +42
+ Misses 1053 1036 -17
- Partials 354 355 +1 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Pablo Baeyens <pbaeyens31+github@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.
LGTM, needs make goporto
and it should be good to go
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
…ty (#10225) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Changes the behavior of `normal` verbosity of the Debug exporter for logs to display each log record in one line of text. Note that if the body of the log record contains newlines, the output will be displayed in multiple lines. This pull request is part of #7806; it implements the change for logs. The changes for metrics and [traces](#10280) will be proposed in separate pull requests. The implementation in this pull request does not display any details on the resource or the scope of the logs. I would like to propose displaying the resource and the scope as separate lines in a separate pull request. This change applies to the Debug exporter only. The behavior of the Logging exporter remains unchanged. To use this behavior, switch from the deprecated Logging exporter to Debug exporter. #### Link to tracking issue - #7806 #### Testing Added unit tests for the formatter. #### Documentation Described the formatting in the Debug exporter's README. --------- Co-authored-by: Roger Coll <roger.coll@elastic.co> Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
…al-verbosity-traces
Looks like you need to do |
// writeAttributes returns a slice of strings in the form "attrKey=attrValue" | ||
func writeAttributes(attributes pcommon.Map) (attributeStrings []string) { | ||
attributes.Range(func(k string, v pcommon.Value) bool { | ||
attribute := fmt.Sprintf("%s=%s", k, v.AsString()) |
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 think I could rewrite writeAttributes
to take buffer
and use buffer.WriteString
instead of fmt.Sprintf
if that helps? Perhaps as a follow-up improvement PR?
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.
Yeah that makes sense, fine for me to do this on a follow up PR
…verbosity (#10462) #### Description This pull request is part of #7806; it implements the change for metrics. The changes for [logs](#10225) and [traces](#10280) have been proposed in separate pull requests. This change applies to the Debug exporter only. The behavior of the Logging exporter remains unchanged. To use this behavior, switch from the deprecated Logging exporter to Debug exporter. #### Link to tracking issue - #7806 #### Testing Added unit tests for the formatter. #### Documentation Described the formatting in the Debug exporter's README.
Description
This is an initial barebones implementation that only outputs the span's name, trace ID and span ID. Other useful fields like duration etc. can be added in follow-up enhancements.
This pull request is part of #7806; it implements the change for traces. The changes for logs and metrics are proposed in separate pull requests.
This change applies to the Debug exporter only. The behavior of the Logging exporter remains unchanged. To use this behavior, switch from the deprecated Logging exporter to Debug exporter.
Link to tracking issue
Testing
Added unit tests for the formatter.
Documentation
Described the formatting in the Debug exporter's README.