Skip to content

feat: Support container ID field (dogstatsd 1.2)#250

Merged
ahmed-mez merged 6 commits intoDataDog:masterfrom
ahmed-mez:master
Feb 4, 2022
Merged

feat: Support container ID field (dogstatsd 1.2)#250
ahmed-mez merged 6 commits intoDataDog:masterfrom
ahmed-mez:master

Conversation

@ahmed-mez
Copy link
Copy Markdown
Contributor

@ahmed-mez ahmed-mez commented Jan 20, 2022

The PR does the following

  • Adds c:<id> field holding the container ID so the agent can attach container tags.

Brief explanation of how the new container field is handled

  • If DD_ENTITY_ID is set, we ignore the container field
  • If DD_ENTITY_ID is not set and DD_ORIGIN_DETECTION_ENABLED is not explicitly set to false or the WithoutOriginDetection() is not invoked, we try to get the app container ID by parsing /proc/self/cgroup. In case of success, the container field in will be set to .

Motivation

  • More granular tags (container tags instead of pod tags)
  • Works for containers outside of Kubernetes (e.g ECS, Fargate)
  • The goal of not reusing dd.internal.entity_id is to avoid parsing the value and guess the prefix on the agent side (avoid costly operations in the hot path)

Notes

Copy link
Copy Markdown
Member

@hush-hush hush-hush left a comment

Choose a reason for hiding this comment

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

I added a few comments. We should wait on the final decision between tags and new field in dogstatsd protocol before going further.

@ahmed-mez ahmed-mez marked this pull request as ready for review January 27, 2022 15:02
@ahmed-mez ahmed-mez requested a review from hush-hush January 27, 2022 15:10
Copy link
Copy Markdown
Member

@hush-hush hush-hush left a comment

Choose a reason for hiding this comment

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

I think it's almost good to go.

@ahmed-mez ahmed-mez requested a review from hush-hush February 1, 2022 13:51
@ahmed-mez ahmed-mez requested a review from hush-hush February 2, 2022 11:56
Copy link
Copy Markdown
Member

@hush-hush hush-hush left a comment

Choose a reason for hiding this comment

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

Thanks for the PR !

@ahmed-mez
Copy link
Copy Markdown
Contributor Author

Thank you for the review @hush-hush ! I'd like to get 👀 on the Agent PR before merging this one.

PTAL when you get a chance! DataDog/datadog-agent#10659

@ahmed-mez ahmed-mez changed the title feat: container origin detection on UDP feat: Support container ID field (dogstatsd 1.2) Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants