Skip to content

feat(telemetry): Add usage examples for setup_console_exporter and setup_otlp_exporter arguments #162

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mrtj
Copy link

@mrtj mrtj commented Jul 15, 2025

Description

Add usage examples for setup_console_exporter and setup_otlp_exporter arguments.

This PR updates the documentation to include the new feature introduced by the following (now merged) pull request in the sdk-python project: strands-agents/sdk-python#365

Type of Change

  • New content addition

Motivation and Context

It explains and shows example of using a new feature in the SDK.

Areas Affected

docs/user-guide/observability-evaluation/traces.md

Screenshots

N/A

Checklist

  • I have read the CONTRIBUTING document
  • My changes follow the project's documentation style
  • I have tested the documentation locally using mkdocs serve
  • Links in the documentation are valid and working
  • Images/diagrams are properly sized and formatted
  • All new and existing tests pass

Additional Notes

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

jer96
jer96 previously approved these changes Jul 21, 2025
@jer96
Copy link
Member

jer96 commented Jul 21, 2025

hi @mrtj i think you'll need to rebase to pull in the latest changes to fix the workflows

Comment on lines +299 to +300
out=logfile,
formatter=lambda span: span.to_json() + linesep,
Copy link
Contributor

@poshinchen poshinchen Jul 21, 2025

Choose a reason for hiding this comment

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

formatter=lambda span: span.to_json() + linesep, is the default behavior so there's no need to introduce additional method (i.e. linesep) here. I would prefer to remove formatter arg. I'm fine about the out arg since it's good to have for users.

In addition, could you move this section after Custom Attribute Tracking? This configuration is more advanced than attributes setup.

Copy link
Author

Choose a reason for hiding this comment

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

It is true that the lambda function above implements the default behavior, but I wanted to show in the documentation that the formatter can indeed be customized. I considered using an alternative serializer, but ultimately concluded that the default is good enough.

I've changed the section order.

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.

3 participants