Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

containermetadata: make default pattern more restrictive #39

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

Gandem
Copy link
Member

@Gandem Gandem commented Nov 13, 2024

What does this PR do?

The existing default pattern would match systemd service names which only contain letter a-f (see added test which fails with the current code).

This commit extracts the container regex pattern used by the datadog-agent, and uses it as a default pattern.

This makes the pattern more restrictive, avoiding the addition of an incorrect container_id tags for some systemd services.

Motivation

Profiles contained an incorrect container id, with the example added in the test.
image

Additional Notes

N/A

How to test the change?

Added tests, and tested locally in the workspace.

@Gandem Gandem requested a review from a team as a code owner November 13, 2024 12:39
the default pattern would match systemd service names which only
contain letter a-f (see added test which fails with the current code)

this commit extracts the container regex pattern used by the
datadog-agent, and uses it as a default pattern.

this makes the pattern more restrictive, avoiding the addition of
an incorrect container_id tags for some systemd services
@Gandem Gandem force-pushed the nayef/fix-default-pattern branch from 0a99c7f to 0f9f30c Compare November 14, 2024 09:29
@Gandem Gandem enabled auto-merge (squash) November 14, 2024 09:30
@Gandem Gandem merged commit d73e5de into main Nov 14, 2024
10 checks passed
@Gandem Gandem deleted the nayef/fix-default-pattern branch November 14, 2024 09:34
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