Skip to content

docs(tracer): update annotation & metadata docs to include full code #1704

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

Conversation

dreamorosi
Copy link
Contributor

Description of your changes

This PR introduces changes to the code snippets found in the Tracer documentation and related to adding annotations and metadata to a segment.

The original snippets were mistakenly not handling the opening and closing of a custom subsegment and were instead suggesting to attempt annotating the facade segment.

This is a mistake because that segment is managed by the service and cannot be modified, resulting in an error.

The PR fixes this and shows the full code snippet.

Related issues, RFCs

Issue number: #1699

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my change is effective and works
  • The PR title follows the conventional commit semantics

Breaking change checklist

Is it a breaking change?: NO

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

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

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

<!---
Instructions:
1. Make sure you follow our Contributing Guidelines: https://github.com/aws-powertools/powertools-lambda-typescript/blob/main/CONTRIBUTING.md
2. Please follow the template, and do not remove any section/item. If something is not applicable leave it empty, but leave it in the PR.
3. -->

## Description of your changes

<!---
Include here a summary of the change.

Please include also relevant motivation and context.

Add any applicable code snippets, links, screenshots, or other resources
that can help us verify your changes.
-->

This PR introduces changes to the code snippets found in the Tracer documentation and related to adding annotations and metadata to a segment.

The original snippets were mistakenly not handling the opening and closing of a custom subsegment and were instead suggesting to attempt annotating the `facade` segment.

This is a mistake because that segment is managed by the service and cannot be modified, resulting in an error.

The PR fixes this and shows the full code snippet.

### Related issues, RFCs

<!---
Add here the number (i.e. #42) to the Github Issue or RFC that is related to this PR.

Don't include any other text, otherwise the Github Issue will not be detected.

Note: If no issue is present the PR might get blocked and not be reviewed.
-->
**Issue number:** #1699

## Checklist

- [x] [My changes meet the tenets criteria](https://docs.powertools.aws.dev/lambda-typescript/#tenets)
- [x] I have performed a *self-review* of my own code
- [x] I have *commented* my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
- [x] I have made corresponding changes to the *documentation*
- [x] My changes generate *no new warnings*
- [ ] I have *added tests* that prove my change is effective and works
- [x] The PR title follows the [conventional commit semantics](https://github.com/aws-powertools/powertools-lambda-typescript/blob/main/.github/semantic.yml#L2)

### Breaking change checklist

***Is it a breaking change?:*** NO

- [ ] I have documented the migration process
- [ ] I have added, implemented necessary warnings (if it can live side by side)

---

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

**Disclaimer**: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.
@dreamorosi dreamorosi requested a review from a team September 21, 2023 09:38
@dreamorosi dreamorosi linked an issue Sep 21, 2023 that may be closed by this pull request
1 task
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Sep 21, 2023
@pull-request-size pull-request-size bot added the size/S PR between 10-29 LOC label Sep 21, 2023
@dreamorosi dreamorosi self-assigned this Sep 21, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@am29d am29d merged commit 0681511 into main Sep 21, 2023
@am29d am29d deleted the 1699-docs-tracer-examples-for-addmetadata-and-addannotation-dont-work branch September 21, 2023 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation size/S PR between 10-29 LOC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Tracer examples for addMetadata and addAnnotation don't work
2 participants