Skip to content

Commit 4af9f14

Browse files
authored
[AWSX] Update the documentation on setting the service tag in the forwarder (#933)
1 parent f0c6d0c commit 4af9f14

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

aws/logs_monitoring/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ If you can't install the Forwarder using the provided CloudFormation template, y
116116
1. Create a Python 3.12 Lambda function using `aws-dd-forwarder-<VERSION>.zip` from the latest [releases][101].
117117
2. Save your [Datadog API key][102] in AWS Secrets Manager, set environment variable `DD_API_KEY_SECRET_ARN` with the secret ARN on the Lambda function, and add the `secretsmanager:GetSecretValue` permission to the Lambda execution role.
118118
3. If you need to forward logs from S3 buckets, add the `s3:GetObject` permission to the Lambda execution role.
119-
4. Set the environment variable `DD_ENHANCED_METRICS` to `false` on the Forwarder. This stops the Forwarder from generating enhanced metrics itself, but it will still forward custom metrics from other lambdas.
119+
4. Set the environment variable `DD_ENHANCED_METRICS` to `false` on the Forwarder. This stops the Forwarder from generating enhanced metrics itself, but it will still forward custom metrics from other lambdas.DdFetchLambdaTags
120120
5. Some AWS accounts are configured such that triggers will not automatically create resource-based policies allowing Cloudwatch log groups to invoke the forwarder. Reference the [CloudWatchLogPermissions][103] to see which permissions are required for the forwarder to be invoked by Cloudwatch Log Events.
121121
6. [Configure triggers][104].
122122
7. Create an S3 bucket, and set environment variable `DD_S3_BUCKET_NAME` to the bucket name. Also provide `s3:GetObject`, `s3:PutObject`, `s3:ListBucket`, and `s3:DeleteObject` permissions on this bucket to the Lambda execution role. This bucket is used to store the different tags cache i.e. Lambda, S3, Step Function and Log Group. Additionally, this bucket will be used to store unforwarded events incase of forwarding exceptions.
@@ -585,6 +585,15 @@ The CloudFormation Stack creates following IAM roles:
585585
]
586586
```
587587

588+
## Service Tag Setting
589+
The value of the `service` tag is determined based on multiple inputs. These inputs are ranked by priority from highest to lowest
590+
1. Log message custom tags: If the log message has a `ddtags` key which contains a `service` tag value, it will be used to override the `service` tag in the log event.
591+
2. Lambda tags cache (applicable for Lambda logs only): Activating `DdFetchLambdaTags` will fetch and store all Lambda functions tags and will override the `service` tag if it wasn't set previously or was set to a default value i.e. `source` value.
592+
3. Cloudwatch log group tags cache (applicable for Cloudwatch logs only): Activating `DdFetchLogGroupTags` will fetch and store all Cloudwatch log groups tags which are added to the `ddtags` entry in the log event. If `service` tag value was set in the tags cache it will be used to set the `service` tag for the log event.
593+
4. Directly setting a `service` tag value in the forwarder's `ddtags` ENV var.
594+
5. Default value equal to the `source` tag.
595+
596+
588597
## Further Reading
589598

590599
Additional helpful documentation, links, and articles:

0 commit comments

Comments
 (0)