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

docs(tracer): extract Tracer code snippets in separate files #1219 #1229

Merged
merged 2 commits into from
Jan 12, 2023

Conversation

niko-achilles
Copy link
Contributor

@niko-achilles niko-achilles commented Jan 11, 2023

Description of your changes

The code snippets are extracted to their own separate files, placed under docs/snippets/tracer.
And project documentation in docs/core/tracer.md references the code snippets, which are extracted to their own separate files.

Code snippets of tracer created, in path docs/snippets/tracer:

  1. basicUsage.ts
  2. sam.ts
  3. middy.ts
  4. decorator.ts
  5. manual.ts
  6. putAnnotation.ts
  7. putMetadata.ts
  8. captureMethodDecorator.ts
  9. captureMethodManual.ts
  10. captureAWSv3.ts
  11. captureAWSAll.ts
  12. captureAWS.ts
  13. captureHTTP.ts
  14. disableCaptureResponseMethod.ts
  15. disableCaptureResponseHandler.ts
  16. disableCaptureResponseMiddy.ts
  17. accessRootTraceId.ts
  18. escapeHatch.ts

Each code snippet is referenced as --8<-- "docs/snippets/tracer/<code-snippet>.ts" in docs/core/tracer.md .

TODO items:

  • Lint code snippets created in path docs/snippets/tracer by using current eslint rules that are used for packages managed by monorepo as workspaces
  • Correct code snippets by consulting the eslint findings.
  • May Adjust the eslint configuration to documentation needs, e.g. allow any type or adjust the code snippets by removing event and context from the handler signature .
  • By consulting the eslint findings, that Fix should be discovered: captureMethodDecorator.ts , see Docs: Example of tracer.captureMethod() should demo in async instead of sync function #1203
  • By consulting the eslint findings, that Fix should be discovered: disableCaptureResponseMethod.ts , see type
  • introduce docs/snippets/tracer as workspace in package.json managed by monorepo

How to verify this change

Modified docs/core/tracer.md
Added code snippets as ts files in path docs/snippets/tracer

Related issues, RFCs

Issue number: #1219 , #729

PR status

Is this ready for review?: YES
Is it a breaking change?: NO

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
  • I have made corresponding changes to the examples
  • My changes generate no new warnings
  • The code coverage hasn't decreased
  • I have added tests that prove my change is effective and works
  • New and existing unit tests pass locally and in Github Actions
  • Any dependent changes have been merged and published
  • The PR title follows the conventional commit semantics

Breaking change checklist

  • 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.

@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Jan 11, 2023
@niko-achilles
Copy link
Contributor Author

@dreamorosi please review this commit and select if needed which TODO items described in the comment should be part of this PR as additional commits .

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 11, 2023
@dreamorosi
Copy link
Contributor

Thanks Niko, let's do 4th and 5th that fix incorrect code.

We'll tackle the others separately since they're all related to linting somehow.

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

Thanks for the work on this Niko, I have checked out the branch locally and run the docs website and all looks good.

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/L PRs between 100-499 LOC
Projects
None yet
2 participants