Skip to content

Conversation

@spikat
Copy link
Contributor

@spikat spikat commented May 23, 2024

What Does This Do

This fixes the CWS on systems using musl, which doesn't expose the gettid() syscall. We replace it instead by directly calling syscall with the related syscall ID.

Motivation

Be able to retrieve trace spans on docker images build upon alpine.

Additional Notes

Only AMD64 and ARM64 archs are handled.

Jira ticket: [PROJ-IDENT]

@spikat spikat force-pushed the jrs/fix-cws-tracing-on-alpine branch from 157c108 to 2798ebc Compare May 23, 2024 13:27
@spikat spikat marked this pull request as ready for review May 23, 2024 13:29
@spikat spikat requested a review from a team as a code owner May 23, 2024 13:29
@spikat spikat requested review from PerfectSlayer and am312 May 23, 2024 13:29
Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

Hey @spikat 👋
Only few minor comments

By the way, how CWS relates to IAST and WAF (if ever)? Because I have no proper label for it.
It stands for "Cloud Workload Security", right?

@spikat spikat force-pushed the jrs/fix-cws-tracing-on-alpine branch from bc29c68 to eeeed83 Compare May 24, 2024 08:02
@spikat
Copy link
Contributor Author

spikat commented May 24, 2024

By the way, how CWS relates to IAST and WAF (if ever)? Because I have no proper label for it. It stands for "Cloud Workload Security", right?

Hi @PerfectSlayer. Exactly, CWS is "Cloud Workload Security", and is part of the CSM (Cloud Security Management). And AFAIK, for instance the only bridge we want to build is bringing APM traces (if available) to enrich CWS logs/signals

And about the label choice, I'm not sure which one to put either :/

@spikat spikat requested a review from PerfectSlayer May 24, 2024 12:09
Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

LGTM!
You have formatting issue so you will need to run ./gradlew :dd-java-agent:cws-tls:spotlessApply.
You can install the hook that runs it automatically: https://github.com/DataDog/dd-trace-java/blob/master/BUILDING.md#clone-the-repository-and-setup-git

For the label, I will create the CWS one. We can edit it later if more features become available 😉

@PerfectSlayer PerfectSlayer added type: bug Bug report and fix comp: cws Cloud Workload Security (CWS) labels May 24, 2024
@PerfectSlayer PerfectSlayer changed the title [CWS] Fix the cws tracer on systems using musl libc (like alpine) Fix the cws tracer on systems using musl libc (like alpine) May 24, 2024
@spikat
Copy link
Contributor Author

spikat commented May 24, 2024

LGTM! You have formatting issue so you will need to run ./gradlew :dd-java-agent:cws-tls:spotlessApply. You can install the hook that runs it automatically: https://github.com/DataDog/dd-trace-java/blob/master/BUILDING.md#clone-the-repository-and-setup-git

Thanks for your review! And sorry for the formating issue, it's fixed now. 😃 Thanks for the links 🙇

For the label, I will create the CWS one. We can edit it later if more features become available 😉

That's perfect! 👍

@spikat spikat merged commit 11dba30 into master May 24, 2024
@spikat spikat deleted the jrs/fix-cws-tracing-on-alpine branch May 24, 2024 14:58
@github-actions github-actions bot added this to the 1.35.0 milestone May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: cws Cloud Workload Security (CWS) type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants