Skip to content

Conversation

@Jayclifford345
Copy link
Contributor

Description

Small PR to update some of the examples we have within the docs folder.

  1. Fixed logs example (collector config errored out due to a bad configuration parameter. The debug component only supports: (detailed|normal|basic)
  2. Added example of adding custom attributes to an event in docs/examples/logs/example.py
  3. Added example for using PeriodicExportingMetricReader to explicitly collect metrics synchronously. This is to provide an example of the workaround for feat: Synchronous Metrics Reader and Exporter #4549

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Run linting
  • Run examples

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated
@Jayclifford345 Jayclifford345 requested a review from a team as a code owner April 22, 2025 12:55
@emdneto emdneto moved this to Easy to review / merge / close in @xrmx's Python PR digest Apr 22, 2025
@Jayclifford345
Copy link
Contributor Author

Hi @emdneto,
Apologies for the spelling errors there, I have updated them and run

tox -e spellcheck 

So should have caught all now. The CHANGELOG test failed, so I added it to the PR to the unreleased section, but thought it was such a minor alteration that it wouldn't be needed ,so happy to remove if you like

Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

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

Thanks. one more change. I think we don't need changelog, but you've already added so it's up to you. If you want, I can add the label to skip it

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
@Jayclifford345
Copy link
Contributor Author

doh! thanks for the catch once again @emdneto :). Thats your change committed.
Now that its there happy to leave it in the changelog since it fixes an example that is breaking without the change :)

@Jayclifford345
Copy link
Contributor Author

Happy to work on more examples / docs in the future so if you have any in the backlog after this just let me know :)

@lzchen lzchen merged commit e0cf233 into open-telemetry:main Apr 23, 2025
386 checks passed
@github-project-automation github-project-automation bot moved this from Easy to review / merge / close to Done in @xrmx's Python PR digest Apr 23, 2025
DylanRussell pushed a commit to DylanRussell/opentelemetry-python that referenced this pull request Apr 29, 2025
) * added examples * Apply suggestions from code review Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> * feat: added examples for metrics and logs * fixed spelling * Update docs/examples/metrics/reader/README.rst Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com> --------- Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants