Skip to content

docs: update environment variable tables for utilities #1153

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

ConnorKirk
Copy link
Contributor

@ConnorKirk ConnorKirk commented Nov 10, 2022

Description of your changes

This PR updates the environment variable documentation for the main page, and three utilities.
It also sets the default service name to service_undefined. Previously, the Tracer and Metrics utilities did not set the service name

  • Update docs/index.md
  • Update Tracer table
  • Update Metric table
  • Update Logger table
  • Set default Service Name in Utility class
  • Update Tracer class to use default service name
  • Update Metrics class to use default service name
  • Extract isValidServiceName to Utility class
  • Update unit tests

How to verify this change

Related issues, RFCs

Issue number: #724

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 in downstream module
  • 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.

* Correct the default value for the POWERTOOLS_METRICS_NAMESPACE env var
* Refer reader to utility page for further info on env vars
* Extract default and allowed values from description to their own cols
* Add allowed values, example and default columns
* Correct default value for metrics namespace
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Nov 10, 2022
flochaz
flochaz previously approved these changes Nov 10, 2022
@dreamorosi dreamorosi linked an issue Nov 10, 2022 that may be closed by this pull request
Previously the Metric and Tracer classes did not set a service name if
one was not provided. There was no default service name.
This commit sets a default service name in the Utility class, and
updates the Tracer, Metric and Logger classes to use it.
Add missing `defaultServiceName` property to expected Logger object
Correct typo in test names
Remove a test that is no longer valid. As there is a default service
name, the tracer should not be enabled even if there is a service name
Update the `addServiceAnnotation` function to remove redundant check
The `service_name` is now set by default. This means it is always
present in metric dimensions. This commit updates the tests to account
for this change
Add test for getDefaultServiceName method
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Nov 14, 2022
@ConnorKirk
Copy link
Contributor Author

Last remaining task is to extract the isValidServiceName method to the Utility class.

This commit extracts the isValidServiceName method from the Tracer class
to the Utility class.
@ConnorKirk ConnorKirk marked this pull request as ready for review November 15, 2022 08:36
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.

Hi @ConnorKirk thank you for the work here, it's looking great and I think we are really close to being able to merge it.

Left just a couple of comments, I think we need 1, maybe 2, more iterations and we're done!

@dreamorosi
Copy link
Contributor

Integration tests are passing: https://github.com/awslabs/aws-lambda-powertools-typescript/actions/runs/3470528039

Since @flochaz already approved the PR earlier, I'm going to merge this.

@dreamorosi dreamorosi self-requested a review November 15, 2022 15:08
@dreamorosi dreamorosi merged commit c37932d into aws-powertools:main Nov 15, 2022
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
Development

Successfully merging this pull request may close these issues.

Docs: add supported values for env variables
3 participants