-
Notifications
You must be signed in to change notification settings - Fork 22
Add CloudWatch EMF exporter foundation with basic Gauge support #382
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
Add CloudWatch EMF exporter foundation with basic Gauge support #382
Conversation
bc2ce38
to
8491507
Compare
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
22ab59b
to
5b6d407
Compare
This PR introduces the core structure for the CloudWatch EMF (Embedded Metric Format) exporter for OpenTelemetry Python. This foundation includes: Core Features: - CloudWatchEMFExporter class with full initialization - Basic EMF log structure creation - Gauge metric conversion and export - Unit mapping from OTel to CloudWatch units - CloudWatch Logs integration with log group/stream management - Metric grouping by attributes and timestamps - Basic error handling and logging Architecture: - Follows OTel MetricExporter interface - Uses boto3 for CloudWatch Logs integration - Implements proper resource attribute handling - Supports DELTA temporality for CloudWatch compatibility Testing: - Comprehensive unit tests for core functionality - Mock-based testing to avoid AWS dependencies - Tests for initialization, conversion, and basic export flow Future PRs will add: - Support for Sum, Histogram, and ExponentialHistogram metrics - Advanced batching and CloudWatch Logs constraints - Enhanced error handling and validation
5b6d407
to
1b34c6f
Compare
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not review _create_emf_log
, _send_log_event
, export
, or unit tests. Will try to take another crack at this this week.
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
f44f3be
to
34a406c
Compare
34a406c
to
7de65e4
Compare
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...ry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/otlp_aws_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
195e95a
to
a0da19f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not look at the unit tests. Will do so in the next pass.
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
...tro/src/amazon/opentelemetry/distro/exporter/otlp/aws/metrics/aws_cloudwatch_emf_exporter.py
Outdated
Show resolved
Hide resolved
LGTM. Thanks for addressing the comments. :) |
This PR introduces the core structure for the CloudWatch EMF exporter for sending custom metrics. So for some specific customers they can send their own custom OTel metrics to CloudWatch metrics backend without requiring any Collector or Agent installed at this moment.
This PR includes:
Changes:
Future PRs will add:
Testing:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.