Skip to content

Conversation

ViBiOh
Copy link
Contributor

@ViBiOh ViBiOh commented Oct 7, 2025

What does this PR do?

This pull-request switch the tag enrichment done by the forwarder to logs-backend by default for both s3 and cloudwatch.

Motivation

Reduce ingestion payload size, s3 reduce cache burden and cost.

Testing Guidelines

Additional Notes

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)
  • This PR passes the unit tests
  • This PR passes the installation tests (ask a Datadog member to run the tests)

@github-actions github-actions bot added the aws label Oct 7, 2025
@ViBiOh ViBiOh changed the base branch from master to aws-forwarder-v5-preparation October 8, 2025 14:02
@ViBiOh ViBiOh changed the title Vibioh/awsx 1566 storage tag Add environment variable to support backend storage tag enrichment Oct 8, 2025
@ViBiOh ViBiOh force-pushed the aws-forwarder-v5-preparation branch from aa79f3a to f7fb1e1 Compare October 8, 2025 15:37
@ViBiOh ViBiOh force-pushed the vibioh/AWSX-1566_storage_tag branch from 3994c02 to e7004da Compare October 8, 2025 15:47
ViBiOh added 2 commits October 8, 2025 17:54
Signed-off-by: Vincent Boutour <vincent.boutour@datadoghq.com>
Signed-off-by: Vincent Boutour <vincent.boutour@datadoghq.com>
@ViBiOh ViBiOh force-pushed the vibioh/AWSX-1566_storage_tag branch from e7004da to c9ec9ae Compare October 8, 2025 15:54
@ViBiOh ViBiOh marked this pull request as ready for review October 14, 2025 13:57
@ViBiOh ViBiOh requested a review from a team as a code owner October 14, 2025 13:58
@ge0Aja ge0Aja self-assigned this Oct 14, 2025
Signed-off-by: Vincent Boutour <vincent.boutour@datadoghq.com>
### Advanced (optional)
`DD_ENRICH_S3_TAGS`
: Instruct Datadog backend to enrich a log coming from a S3 bucket with the tag attached to this bucket. It's the equivalent behavior of `DD_FETCH_S3_TAG` but done after ingestion. This require Resource Collection to be enabled. Flag is enabled by default.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rephrase with something like
True by default. Enables S3 tag enrichment at intake time for logs coming from S3 buckets. Equivalent to DD_FETCH_S3_TAG` once the logs are ingested in Datadog. This parameter requires Resource Collection to be enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"at intake time" is a bit ambiguous, before or after intake? because it impacts billing.

"S3 tag" is also ambiguous, "S3 Bucket tag" is precise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I feel strongly about having a link to our documentation for resource collection.
For the other parts I don't mind keeping them as is, the key part that we want the reader to understand is that the tags will appear in the logs after they're ingested by Datadog, meaning they don't pay for the volume of the log the tag contribute to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revamped it with Claude


storage_tag = get_dd_storage_tag_header()
if storage_tag != "":
_HEADERS["DD-STORAGE-TAG"] = storage_tag
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe set the header key as a constant (now that I comment that I'd argue the other should be too)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only used in one place. I don't think it worth it. We'll do some back and forth in code for something that is used at only one place.

… metrics

Signed-off-by: Vincent Boutour <vincent.boutour@datadoghq.com>
Signed-off-by: Vincent Boutour <vincent.boutour@datadoghq.com>
@ViBiOh ViBiOh merged commit 7a39141 into aws-forwarder-v5-preparation Oct 16, 2025
7 checks passed
@ViBiOh ViBiOh deleted the vibioh/AWSX-1566_storage_tag branch October 16, 2025 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants