Skip to content

Conversation

jj22ee
Copy link
Contributor

@jj22ee jj22ee commented Jul 30, 2025

Issue #, if available:

Description of changes:

Testing:
Lambda code:

import json
import logging

from logging import Logger, getLogger

_logger: Logger = getLogger("__name__")

def lambda_handler(event, context):
    _logger.error("helloooooo1")
    _logger.error("helloooooo2")
    _logger.error("helloooooo3")
    _logger.error("helloooooo4")
    _logger.error("helloooooo5")
    return {
        'statusCode': 200,
        'body': json.dumps('Hello from Lambda!')
    }

Env vars:

AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-instrument
OTEL_LOGS_EXPORTER=otlp
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true

See that one log is in one CWLog line.
image

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

@jj22ee jj22ee requested a review from a team as a code owner July 30, 2025 19:03
@jj22ee jj22ee force-pushed the compressed-console-log-exporter branch from e6ea11d to 821ad50 Compare July 30, 2025 19:38
@jj22ee jj22ee changed the title Add Compressed Console Log Exporter for Lambda Environment Add Compact Console Log Exporter for Lambda Environment Jul 30, 2025
@jj22ee jj22ee merged commit 2388f5f into aws-observability:main Jul 31, 2025
13 checks passed
jj22ee added a commit that referenced this pull request Aug 13, 2025
*Issue #, if available:*

*Description of changes:*

*Testing:*
Lambda code:
```
import json
import logging

from logging import Logger, getLogger

_logger: Logger = getLogger("__name__")

def lambda_handler(event, context):
    _logger.error("helloooooo1")
    _logger.error("helloooooo2")
    _logger.error("helloooooo3")
    _logger.error("helloooooo4")
    _logger.error("helloooooo5")
    return {
        'statusCode': 200,
        'body': json.dumps('Hello from Lambda!')
    }
```

Env vars:
```
AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-instrument
OTEL_LOGS_EXPORTER=otlp
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
```
See that one log is in one CWLog line.
<img width="2344" height="748" alt="image"
src="https://github.com/user-attachments/assets/3f09900e-fad6-4f90-b9a4-a8006a5b259d"
/>


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
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.

2 participants