Skip to content

[exporter/debug] display resource and scope in normal verbosity #13011

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

Merged
merged 8 commits into from
May 21, 2025

Conversation

andrzej-stencel
Copy link
Member

@andrzej-stencel andrzej-stencel commented May 9, 2025

Description

Adds displaying of resource and scope details in normal verbosity.

Each resource is represented with one line showing the resource's details:

  • schema URL
  • resource attributes

which looks like ResourceTraces #0 [resource-schema-url] resource_attr1=value1 attr2=value2.

Each instrumentation scope is represented by one line showing the scope's details:

  • scope name
  • scope version
  • scope schema URL
  • scope attributes

which looks like ScopeTraces #0 scope-name@scope-version [scope-schema-url] scope_attr1=value1 attr2=value2.

Before:

2025-05-09T19:57:16.332+0200    info    Traces  {"resource": {}, "otelcol.component.id": "debug/normal", "otelcol.component.kind": "exporter", "otelcol.signal": "traces", "resource spans": 1, "spans": 2}
2025-05-09T19:57:16.332+0200    info    okey-dokey-0 ab1030bd4ee554af936542b01d7b4807 1d8c93663d043aa8 net.sock.peer.addr=1.2.3.4 peer.service=telemetrygen-client
lets-go ab1030bd4ee554af936542b01d7b4807 0d238e8a2f97733f net.sock.peer.addr=1.2.3.4 peer.service=telemetrygen-server
        {"resource": {}, "otelcol.component.id": "debug/normal", "otelcol.component.kind": "exporter", "otelcol.signal": "traces"}

After:

2025-05-09T19:57:16.332+0200    info    Traces  {"resource": {}, "otelcol.component.id": "debug/normal", "otelcol.component.kind": "exporter", "otelcol.signal": "traces", "resource spans": 1, "spans": 2}
2025-05-09T19:57:16.332+0200    info    ResourceTraces #0 [https://opentelemetry.io/schemas/1.25.0] service.name=telemetrygen
ScopeTraces #0 telemetrygen
okey-dokey-0 ab1030bd4ee554af936542b01d7b4807 1d8c93663d043aa8 net.sock.peer.addr=1.2.3.4 peer.service=telemetrygen-client
lets-go ab1030bd4ee554af936542b01d7b4807 0d238e8a2f97733f net.sock.peer.addr=1.2.3.4 peer.service=telemetrygen-server
        {"resource": {}, "otelcol.component.id": "debug/normal", "otelcol.component.kind": "exporter", "otelcol.signal": "traces"}

Link to tracking issue

Fixes #10515

Testing

Updated unit tests.

Documentation

Updated example in documentation.

@andrzej-stencel andrzej-stencel requested a review from a team as a code owner May 9, 2025 18:10
@andrzej-stencel andrzej-stencel requested a review from mx-psi May 9, 2025 18:10
@github-actions github-actions bot added the exporter/debug Issues related to the Debug exporter label May 9, 2025
@andrzej-stencel andrzej-stencel changed the title [exporter/debug] display resource and scope in normal mode [exporter/debug] display resource and scope in normal verbosity May 9, 2025
Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.60%. Comparing base (094e1fa) to head (07997d6).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13011      +/-   ##
==========================================
+ Coverage   91.58%   91.60%   +0.01%     
==========================================
  Files         505      505              
  Lines       28319    28370      +51     
==========================================
+ Hits        25937    25988      +51     
  Misses       1873     1873              
  Partials      509      509              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mx-psi mx-psi added this pull request to the merge queue May 21, 2025
Merged via the queue into open-telemetry:main with commit e6c05b8 May 21, 2025
56 checks passed
@andrzej-stencel andrzej-stencel deleted the add-resource-scope branch May 22, 2025 10:44
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.

[exporter/debug] Include Resource/Scope info in normal verbosity mode
2 participants