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

[exporter/debug] format log records as one-liners in normal verbosity #10225

Conversation

andrzej-stencel
Copy link
Member

@andrzej-stencel andrzej-stencel commented May 27, 2024

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 are 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

Testing

Added unit tests for the formatter.

Documentation

Described the formatting in the Debug exporter's README.

@andrzej-stencel andrzej-stencel requested review from a team and jpkrohling May 27, 2024 10:55
Copy link

codecov bot commented May 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.61%. Comparing base (4e354aa) to head (f6a10c1).
Report is 70 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10225      +/-   ##
==========================================
+ Coverage   92.60%   92.61%   +0.01%     
==========================================
  Files         386      387       +1     
  Lines       18221    18248      +27     
==========================================
+ Hits        16873    16900      +27     
  Misses       1003     1003              
  Partials      345      345              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andrzej-stencel
Copy link
Member Author

Test coverage should be improved by #10242.

Copy link
Contributor

@rogercoll rogercoll left a comment

Choose a reason for hiding this comment

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

LGTM, just a few minor comments.

exporter/debugexporter/README.md Outdated Show resolved Hide resolved
exporter/debugexporter/exporter.go Show resolved Hide resolved
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jun 21, 2024
@mx-psi mx-psi merged commit 426e660 into open-telemetry:main Jun 21, 2024
49 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 21, 2024
@andrzej-stencel andrzej-stencel deleted the debug-exporter-normal-verbosity-logs branch June 21, 2024 08:03
@andrzej-stencel andrzej-stencel restored the debug-exporter-normal-verbosity-logs branch June 21, 2024 08:03
mx-psi added a commit that referenced this pull request Jun 24, 2024
…0280)

#### 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](#10225)
and metrics will be 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.

---------

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
mx-psi pushed a commit that referenced this pull request Jun 24, 2024
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/debug Issues related to the Debug exporter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants