Skip to content

Add a DISABLE_METRIC_EXTRACTION config option #55

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

Merged
merged 2 commits into from
Aug 31, 2020
Merged

Add a DISABLE_METRIC_EXTRACTION config option #55

merged 2 commits into from
Aug 31, 2020

Conversation

Dunedan
Copy link
Contributor

@Dunedan Dunedan commented Aug 28, 2020

This adds a new configuration option DISABLE_METRIC_EXTRACTION which
removes the _aws metadata from the EMF log records, thus disabling the
extraction of metrics by CloudWatch Metrics. The remaining part of the
log records is still getting logged.

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

Fixes #34

This adds a new configuration option `DISABLE_METRIC_EXTRACTION` which
removes the `_aws` metadata from the EMF log records, thus disabling the
extraction of metrics by CloudWatch Metrics. The remaining part of the
log records is still getting logged.
@jaredcnance
Copy link
Member

jaredcnance commented Aug 28, 2020

Thanks for the PR! Build is currently failing due to:

aws_embedded_metrics/serializers/log_serializer.py:23:1: E303 too many blank lines (3)
118 | ERROR: InvocationError for command /codebuild/output/src419401436/src/github.com/awslabs/aws-embedded-metrics-python/.tox/flake8/bin/flake8 aws_embedded_metrics tests (exited with code 1)
119
...
aws_embedded_metrics/serializers/log_serializer.py:42: error: Incompatible types in assignment (expression has type "Dict[str, List[Dict[str, object]]]", target has type "str")
--
126 | Found 1 error in 1 file (checked 24 source files)
127 | ERROR: InvocationError for command /codebuild/output/src419401436/src/github.com/awslabs/aws-embedded-metrics-python/.tox/mypy/bin/mypy aws_embedded_metrics (exited with code 1)

@Dunedan
Copy link
Contributor Author

Dunedan commented Aug 31, 2020

I fixed those issues now and locally tests run fine, however on CodeBuild they still seem to fail. No idea why, because I can't access the CodeBuild output.

@jaredcnance jaredcnance merged commit 066df53 into awslabs:master Aug 31, 2020
@jaredcnance
Copy link
Member

Tests failed due to a race condition in one of the agent tests where the socket wasn't available for re-use yet.

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.

Ability to disable metric extraction
2 participants