Skip to content

Commit 3896b02

Browse files
Merge remote-tracking branch 'origin/master' into gaetan.deputier/disable-ssl-validation-lambda
2 parents 24bb0a5 + c9d0b85 commit 3896b02

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

aws/logs_monitoring/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ If the `DD_FETCH_LAMBDA_TAGS` env variable is set to `true` then the log forward
140140

141141
To configure your function:
142142

143-
1. Set the memory to 1024 MB.s
143+
1. Set the memory to 1024 MB.
144144
2. Also set the timeout limit. 120 seconds is recommended to deal with big files.
145-
3. Hit the `Save and Test` button.
145+
3. Hit the `Save` button.
146146

147147
### 6. Test it
148148

149-
If the test "succeeded", you are all set! The test log doesn't show up in the platform.
149+
Hit the `Test` button, and select `CloudWatch Logs` as the sample event. If the test "succeeded", you are all set! The test log doesn't show up in the platform.
150150

151151
**Note**: For S3 logs, there may be some latency between the time a first S3 log file is posted and the Lambda function wakes up.
152152

aws/logs_monitoring/lambda_function.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,11 @@ def awslogs_handler(event, context, metadata):
829829
# Default `env` to `none` and `service` to the function name,
830830
# for correlation with the APM env and service.
831831
metadata[DD_SERVICE] = function_name
832-
metadata[DD_CUSTOM_TAGS] += ",env:none"
832+
833+
env_tag_exists = metadata[DD_CUSTOM_TAGS].startswith('env:') or ',env:' in metadata[DD_CUSTOM_TAGS]
834+
# If there is no env specified, default to env:none
835+
if not env_tag_exists:
836+
metadata[DD_CUSTOM_TAGS] += ",env:none"
833837

834838
# Create and send structured logs to Datadog
835839
for log in logs["logEvents"]:

0 commit comments

Comments
 (0)