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

improv: Better namespace/dimension handling for Metrics #62

Merged
merged 9 commits into from
Jun 7, 2020

Conversation

to-mc
Copy link
Contributor

@to-mc to-mc commented Jun 7, 2020

Issue #, if available: #61

Description of changes:

Changes behavior introduced in #60: Service name passed to metrics constructor (or POWERTOOLS_SERVICE_NAME env var) will be used to create a service dimension rather than setting the namespace. Namespace can be set using the namespace parameter in Metrics constructor, or POWERTOOLS_METRICS_NAMESPACE env var.

Breaking change checklist

Ignore if it's not a breaking change

RFC issue #:

  • Migration process documented
  • Implement 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.

@to-mc to-mc changed the title improv: Improv/metrics interface fix improv: Better namespace/dimension handling for Metrics Jun 7, 2020
@to-mc to-mc requested a review from heitorlessa June 7, 2020 09:21
@codecov-commenter
Copy link

codecov-commenter commented Jun 7, 2020

Codecov Report

Merging #62 into develop will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop      #62   +/-   ##
========================================
  Coverage    99.39%   99.39%           
========================================
  Files           15       15           
  Lines          492      496    +4     
  Branches        44       45    +1     
========================================
+ Hits           489      493    +4     
  Misses           3        3           
Impacted Files Coverage Δ
aws_lambda_powertools/metrics/base.py 100.00% <100.00%> (ø)
aws_lambda_powertools/metrics/metric.py 100.00% <100.00%> (ø)
aws_lambda_powertools/metrics/metrics.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f074de...0e81377. Read the comment docs.

@to-mc to-mc requested a review from nmoutschen June 7, 2020 09:53
docs/content/core/metrics.mdx Outdated Show resolved Hide resolved
example/template.yaml Show resolved Hide resolved
@heitorlessa heitorlessa merged commit 32459e2 into develop Jun 7, 2020
@heitorlessa heitorlessa deleted the improv/metrics_interface_fix branch June 7, 2020 13:47
heitorlessa added a commit that referenced this pull request Jun 7, 2020
* develop:
  improv: include example tests in `make tests` (#63)
  chore: rename Makefile target docs-dev to docs-local (#65)
  improv: better namespace/dimension handling for Metrics (#62)
heitorlessa added a commit that referenced this pull request Jun 10, 2020
* develop: (31 commits)
  docs: fix contrast on highlighted code text (#73)
  feat: improve error handling for log_metrics decorator (#71)
  chore(deps): bump graphql-playground-html from 1.6.19 to 1.6.25 in /docs
  feat: add high level imports (#70)
  fix: correct env var name for publish to pypi test (#69)
  chore: version bump (#68)
  feat: add capture_cold_start_metric for log_metrics (#67)
  chore(deps): bump websocket-extensions from 0.1.3 to 0.1.4 in /docs (#66)
  feat: automate publishing to pypi (#58)
  feat: add pre-commit hooks (#64)
  improv: include example tests in `make tests` (#63)
  chore: rename Makefile target docs-dev to docs-local (#65)
  improv: better namespace/dimension handling for Metrics (#62)
  docs: build on master only
  chore: correct docstring for log_metrics
  chore: fix typo in metrics doc
  chore: Correct test comment
  chore: remove unused import
  chore: formatting
  feat: update Metrics interface to resemble tracer & logger: use "service" as its namespace.
  ...
heitorlessa referenced this pull request in heitorlessa/aws-lambda-powertools-python Jun 17, 2020
* improv: namespace/dimension changes

Use service name for default dimension instead of namespace
Add namespace parameter

* docs: document changes to namespace/service

* chore: fix typo in docstring

* chore: fix typo in docs

* chore: fix test comments

* chore: Add env var for namespace back into example app

* chore: correct typo in docs

* chore: update example in README
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.

None yet

3 participants