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

[PROF-6463] Implement support for endpoint profiling in CpuAndWallTime collector #2384

Merged
merged 2 commits into from
Nov 22, 2022

Conversation

ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Nov 18, 2022

What does this PR do?:

This PR reimplements support for the profiling endpoint feature in the CpuAndWallTime collector.

Although the implementation is different, the approach is conceptually the same as provided by Datadog::Profiling::TraceIdentifiers::Ddtrace for the old profiler codepaths.

The constraints of this implementation are the same as the ones in #2342 and effectively this is only a small extension of the work done in that PR.

Motivation:

Endpoint profiling allows customers to filter down their profiles to individual endpoints (for web apps) that they may be interested in investigating.

Additional Notes:

Comparing a Ruby string with a char * is really annoying.

How to test the change?:

Beyond the code coverage included by the change, it can also be tested by enabling profiling and tracing for a Ruby web app, and then checking that the application's endpoints show up in the right sidebar in the profiling UX.

Ruby doesn't mind that we call `instance_variable_get` on `nil`, but it
will emit warnings, which can be annoying.

To avoid this, let's properly check that things are `nil` before
using them.
…e collector

**What does this PR do?**:

This PR reimplements support for the profiling endpoint feature
in the `CpuAndWallTime` collector.

Although the implementation is different, the approach is conceptually
the same as provided by `Datadog::Profiling::TraceIdentifiers::Ddtrace`
for the old profiler codepaths.

The constraints of this implementation are the same as the ones in
 #2342 and effectively this is only a small extension of the work
done in that PR.

**Motivation**:

Endpoint profiling allows customers to filter down their profiles to
individual endpoints (for web apps) that they may be interested
in investigating.

**Additional Notes**:

Comparing a Ruby string with a `char *` is really annoying.

**How to test the change?**:

Beyond the code coverage included by the change, it can also be
tested by enabling profiling and tracing for a Ruby web app, and
then checking that the application's endpoints show up in the right
sidebar in the profiling UX.
@ivoanjo ivoanjo requested a review from a team November 18, 2022 11:42
@github-actions github-actions bot added the profiling Involves Datadog profiling label Nov 18, 2022
//
// Instead of each sample for the same local_root_span_id getting a potentially-different endpoint,
// `record_endpoint` (via libdatadog) keeps a list of local_root_span_id values and their most-recently-seen
// endpoint values, and at serialization time the most-recently-seen endpoint is applied to all relevant samples.
Copy link
Member

Choose a reason for hiding this comment

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

most-recently-seen endpoint is applied to all relevant samples

This is a very reasonable approach! 👍 👍 👍

@ivoanjo ivoanjo merged commit 3eb734e into master Nov 22, 2022
@ivoanjo ivoanjo deleted the ivoanjo/prof-6463-endpoint-profiling branch November 22, 2022 08:41
@github-actions github-actions bot added this to the 1.7.0 milestone Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
profiling Involves Datadog profiling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants