You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aws-opentelemetry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/logs/aws_batch_log_record_processor.py
+45-13Lines changed: 45 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
# SPDX-License-Identifier: Apache-2.0
3
+
# Modifications Copyright The OpenTelemetry Authors. Licensed under the Apache License 2.0 License.
3
4
4
5
importlogging
5
6
fromtypingimportMapping, Optional, Sequence, cast
@@ -19,7 +20,7 @@ class AwsCloudWatchOtlpBatchLogRecordProcessor(BatchLogRecordProcessor):
19
20
Custom implementation of BatchLogRecordProcessor that manages log record batching
20
21
with size-based constraints to prevent exceeding AWS CloudWatch Logs OTLP endpoint request size limits.
21
22
22
-
This processor still exports all logs up to _max_export_batch_size but rather than doing exactly
23
+
This processor still exports all logs up to _MAX_LOG_REQUEST_BYTE_SIZE but rather than doing exactly
23
24
one export, we will estimate log sizes and do multiple batch exports
24
25
where each exported batch will have an additional constraint:
25
26
@@ -29,9 +30,41 @@ class AwsCloudWatchOtlpBatchLogRecordProcessor(BatchLogRecordProcessor):
29
30
A unique case is if the sub-batch is of data size > 1 MB, then the sub-batch will have exactly 1 log in it.
30
31
"""
31
32
32
-
_BASE_LOG_BUFFER_BYTE_SIZE= (
33
-
1000# Buffer size in bytes to account for log metadata not included in the body or attribute size calculation
34
-
)
33
+
# OTel log events include fixed metadata attributes so the estimated metadata size
34
+
# possibly be calculated as this with best efforts:
Copy file name to clipboardExpand all lines: aws-opentelemetry-distro/src/amazon/opentelemetry/distro/exporter/otlp/aws/traces/otlp_aws_span_exporter.py
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,14 @@
18
18
19
19
20
20
classOTLPAwsSpanExporter(OTLPSpanExporter):
21
+
"""
22
+
This exporter extends the functionality of the OTLPSpanExporter to allow spans to be exported
23
+
to the XRay OTLP endpoint https://xray.[AWSRegion].amazonaws.com/v1/traces. Utilizes the
24
+
AwsAuthSession to sign and directly inject SigV4 Authentication to the exported request's headers.
Copy file name to clipboardExpand all lines: aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/exporter/otlp/aws/logs/test_otlp_aws_logs_exporter.py
0 commit comments