Skip to content

Add add_metadata in the metrics feature #80

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

Closed
pcolazurdo opened this issue Jun 15, 2020 · 2 comments
Closed

Add add_metadata in the metrics feature #80

pcolazurdo opened this issue Jun 15, 2020 · 2 comments
Assignees
Labels
feature-request feature request

Comments

@pcolazurdo
Copy link

Description of the Problem/Issue
When publishing metrics, it's would be useful to be able to reference the specific values that generated the specific metric value.

For example, in one project I'm crawling some URLs. In this case I log the size of the fetched object as a metric. Being able to annotate that metric (add_property in the aws-embedded-metrics-python library) with the URL it's very useful when doing insights after. If I rely on Tracing info, this means I depend on xray and also will be affected by sampling.

Logging this in a structured logging, will separate the information from the metric, so parsing the logs will be much harder, so being able to add this info along with the metric publishing would be useful.

Describe the solution you'd like
Add an add_metadata or add_property method to metrics similar to the one found in aws-embedded-metrics-python

Describe alternatives you've considered

  • Using Tracing - not useful due to:
    • Depend on Xray for reading the info
    • Will be affected by sampling
  • Using Logging - not useful due to complexity when querying the logs. Also, if this info is recorded at Debug level, lot of other info will be also published which probably is not the intention. The same at any other level.
@pcolazurdo pcolazurdo added feature-request feature request triage Pending triage from maintainers labels Jun 15, 2020
@ghost ghost removed the triage Pending triage from maintainers label Jun 15, 2020
@heitorlessa heitorlessa self-assigned this Jun 15, 2020
heitorlessa referenced this issue in heitorlessa/aws-lambda-powertools-python Jun 15, 2020
heitorlessa referenced this issue in heitorlessa/aws-lambda-powertools-python Jun 15, 2020
Signed-off-by: heitorlessa <[email protected]>
@heitorlessa
Copy link
Contributor

Thanks for opening the issue Pablo!

I'm just waiting an approval of the final implementation we discussed, and it will be available in 1.0.0

heitorlessa added a commit that referenced this issue Jun 16, 2020
* chore: remove Logger deprecated code

* chore: remove Metrics deprecated code

* chore: remove models from deprecated code

* chore: move logger formatter to its own file

* chore: cleanup metrics tests

* chore: cleanup tracer tests

* chore: cleanup logger tests

* chore: cleanup tracer tests

* chore: set test coverage to 90% min

Signed-off-by: heitorlessa <[email protected]>

* feat: add metrics metadata #80

* docs: add metrics metadata #80

Signed-off-by: heitorlessa <[email protected]>

* chore: refactor metric serialization

* improv: test metadata with log_metrics

* improv: test serialize metric with valid EMF object
@heitorlessa
Copy link
Contributor

It's now merged in develop :)

If you need this feature as of now, you can install the dev version: pip install git+https://github.com/awslabs/aws-lambda-powertools-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request feature request
Projects
None yet
Development

No branches or pull requests

2 participants