Skip to content

RUM-9755: Add Jetpack Compose Instrumentation documentation #29110

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ambushwork
Copy link
Member

What does this PR do? What is the motivation?

Add documentation page to explain how to instrument Jetpack Compose manually or automatically using the Datadog Gradle Plugin.

Merge instructions

Merge readiness:

  • Release of dd-sdk-android 2.21.0
  • Release of dd-sdk-android-gradle-plugin 1.17.0

For Datadog employees:
Merge queue is enabled in this repo. Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). Without this format, your pull request will not pass in CI, the GitLab pipeline will not run, and you won't get a branch preview. Getting a branch preview makes it easier for us to check any issues with your PR, such as broken links.

If your branch doesn't follow this format, rename it or create a new branch and PR.

To have your PR automatically merged after it receives the required reviews, add the following PR comment:

/merge

Additional notes

@github-actions github-actions bot added the Images Images are added/removed with this PR label May 2, 2025
@ambushwork ambushwork force-pushed the ylu/add-compose-instrumentation-doc branch 8 times, most recently from e3fd731 to a831dc4 Compare May 6, 2025 08:18
@github-actions github-actions bot added the Architecture Everything related to the Doc backend label May 6, 2025
@ambushwork ambushwork force-pushed the ylu/add-compose-instrumentation-doc branch 3 times, most recently from 319bef2 to 6fe16fd Compare May 6, 2025 10:23
As described in the [Setup section][2], declare the [Datadog Gradle Plugin][3] in your build script and apply it to each module you want to instrument.

<div class="alert alert-info"><p>
The Datadog Gradle Plugin scans @Composable functions and adds Semantics tags to their modifiers. These tags allow Datadog RUM to track user interactions on Compose components with the correct target information. The plugin also detects NavHost usage and listens to Jetpack Compose navigation events.

Choose a reason for hiding this comment

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

You might want to put @Composable and NavHost in quotes so that it is shown as code. You do it in other places.

Copy link
Member Author

Choose a reason for hiding this comment

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

alert alert-info doesn't support markdown inside, that's why I remove it delibrately.

Copy link
Contributor

Choose a reason for hiding this comment

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

actually, you could do this:

Suggested change
The Datadog Gradle Plugin scans @Composable functions and adds Semantics tags to their modifiers. These tags allow Datadog RUM to track user interactions on Compose components with the correct target information. The plugin also detects NavHost usage and listens to Jetpack Compose navigation events.
The Datadog Gradle Plugin scans <code>@Composable</code> functions and adds Semantics tags to their modifiers. These tags allow Datadog RUM to track user interactions on Compose components with the correct target information. The plugin also detects <code>NavHost</code> usage and listens to Jetpack Compose navigation events.

@ambushwork ambushwork force-pushed the ylu/add-compose-instrumentation-doc branch from 6fe16fd to 91868a1 Compare May 6, 2025 12:02
@ambushwork ambushwork marked this pull request as ready for review May 6, 2025 15:06
@ambushwork ambushwork requested a review from a team as a code owner May 6, 2025 15:06
@maycmlee
Copy link
Contributor

maycmlee commented May 6, 2025

Created docs card for docs review: https://datadoghq.atlassian.net/browse/DOCS-10800

@maycmlee maycmlee added the editorial review Waiting on a more in-depth review label May 6, 2025
Copy link
Member

@0xnm 0xnm left a comment

Choose a reason for hiding this comment

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

lgtm, I left few suggestions

@ambushwork ambushwork force-pushed the ylu/add-compose-instrumentation-doc branch from 91868a1 to 8d09a89 Compare May 7, 2025 12:05
Copy link
Contributor

@rtrieu rtrieu left a comment

Choose a reason for hiding this comment

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

Hi @ambushwork, thank you for this PR! Aside from some of the suggestions I've made, I have a few questions:

  • would love to know your thoughts on moving this content and putting it as a tab on the Android setup page similar to how we document setup for React Native and related frameworks. I'm not sure how customers think about this framework in particular, how popular it is, and realize it might impact searchability. But at the same time, I'm not sure if it makes sense sitting between Integrated Libraries and Troubleshooting at the moment.
  • are there any additional steps after instrumentation that we should add, such as re-initializing the application?

Let me know if you have any questions about my feedback and/or submit a re-request for review.

As described in the [Setup section][2], declare the [Datadog Gradle Plugin][3] in your build script and apply it to each module you want to instrument.

<div class="alert alert-info"><p>
The Datadog Gradle Plugin scans @Composable functions and adds Semantics tags to their modifiers. These tags allow Datadog RUM to track user interactions on Compose components with the correct target information. The plugin also detects NavHost usage and listens to Jetpack Compose navigation events.
Copy link
Contributor

Choose a reason for hiding this comment

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

actually, you could do this:

Suggested change
The Datadog Gradle Plugin scans @Composable functions and adds Semantics tags to their modifiers. These tags allow Datadog RUM to track user interactions on Compose components with the correct target information. The plugin also detects NavHost usage and listens to Jetpack Compose navigation events.
The Datadog Gradle Plugin scans <code>@Composable</code> functions and adds Semantics tags to their modifiers. These tags allow Datadog RUM to track user interactions on Compose components with the correct target information. The plugin also detects <code>NavHost</code> usage and listens to Jetpack Compose navigation events.

@ambushwork ambushwork force-pushed the ylu/add-compose-instrumentation-doc branch from 263ccf0 to c4b2a12 Compare May 16, 2025 13:37
Copy link
Contributor

@rtrieu rtrieu left a comment

Choose a reason for hiding this comment

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

one last thing to fix before it's ready!

@ambushwork ambushwork force-pushed the ylu/add-compose-instrumentation-doc branch from c4b2a12 to 2b2f9bb Compare May 19, 2025 07:43
@ambushwork ambushwork requested a review from rtrieu May 19, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture Everything related to the Doc backend editorial review Waiting on a more in-depth review Images Images are added/removed with this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants