mcpbeat Sign in

Android SDK Event Inspection Agent Skill

Use when verifying SDK event payloads in the Android SDK sandbox, debugging what events are emitted, or validating request bodies via logcat with the sample Kotlin app.

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
226
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/DataDog/dd-sdk-android --skill android-sdk-event-inspection

The instruction itself

14 sections, as written by the author

Datadog Android SDK — Event Inspection

Overview

The Android SDK uses CurlInterceptor to log every outgoing HTTP request as a curl command. In debug builds, enabling printBody = true exposes the full JSON payloads sent to intake endpoints.

Core principle: Enable body logging BEFORE building, then rebuild + reinstall. Build-time config (config/{flavor}.json) is baked into BuildConfig — changes only take effect after a fresh build.

When to Use

  • Verifying a change emits the correct event type or fields
  • Checking custom attributes appear on a log, trace, RUM, Session Replay or Profiling event
  • Debugging why RUM/logs/traces/Session Replay/Profiling are not showing up in Datadog
  • Validating SDK behavior with the sample/kotlin app

mobile-mcp — use alongside this skill to interact with the device and generate events (taps, navigation, actions) that you then observe via logcat.

Setup

1. Enable Request Body Logging

In dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/internal/CoreFeature.kt, find the OkHttpClient builder block inside if (BuildConfig.DEBUG) and enable body printing on the CurlInterceptor:

// Before (body suppressed):
builder.addNetworkInterceptor(CurlInterceptor())

// After (full JSON payloads visible):
builder.addNetworkInterceptor(CurlInterceptor(printBody = true))

This change is gated by BuildConfig.DEBUG — it only runs in debug builds.

2. Configure Build-Time Credentials

Create config/{flavor}.json (e.g., config/us1.json) — values are injected into BuildConfig at compile time. Fake/placeholder values are fine — real Datadog credentials are not required for local event inspection:

{
  "token": "pub<32-hex-chars>",
  "rumApplicationId": "<uuid>",
  "apiKey": "<40-hex-chars>",
  "applicationKey": "<40-hex-chars>",
  "logsEndpoint": "https://browser-intake-datadoghq.com",
  "tracesEndpoint": "https://browser-intake-datadoghq.com",
  "rumEndpoint": "https://browser-intake-datadoghq.com",
  "sessionReplayEndpoint": "https://browser-intake-datadoghq.com"
}

Token format must be pub + 32 hex chars. Any UUID works for rumApplicationId. The SDK will emit and batch events locally even with fake credentials (401 errors on intake are expected and harmless).

3. Build and Install

Ensure JAVA_HOME and ANDROID_HOME are set in your environment, then run:

./gradlew :sample:kotlin:install{Flavor}Debug
# e.g. installUs1Debug, installStagingDebug

> Full environment setup (Java, Android SDK, emulator) belongs in AGENTS.md (not yet created — tracked as follow-up work).

4. Launch the App

# Find the launcher activity (run once to confirm):
adb shell dumpsys package com.datadog.android.sample | grep -A2 "MAIN"
# → com.datadog.android.sample/.NavActivity

adb shell am start -n com.datadog.android.sample/.NavActivity

5. Stream Logcat

adb logcat -s "Datadog" "DD_LOG" "Curl" "*:S"

Log Tags Quick Reference

| Tag | What it shows |

|---|---|

| Datadog | User-facing SDK warnings and info (init, feature flags) |

| DD_LOG | Internal debug: queue state, upload decisions, errors |

| Curl | Full outgoing HTTP requests including JSON body |

Event Structure in Curl Logs

Each Curl log line is a single curl command. The -d argument contains the request body:

Logs (/api/v2/logs):

[
  {
    "message": "onStart",
    "status": "debug",
    "service": "com.datadog.android.sample",
    "date": "...",
    "application_id": "...",
    "session_id": "...",
    "view.id": "...",
    "usr": { "id": "...", "anonymous_id": "..." },
    "ddtags": "build_type:debug,flavor:us1,env:debug,..."
  }
]

Session Replay (/api/v2/replay): multipart/form-data — image parts (WebP) are only present when recording in image mode; wireframe mode produces a different body structure.

RUM (/api/v2/rum): newline-delimited JSON events.

Traces (/api/v2/traces): application/msgpack — binary, not readable as text.

Profiling (/api/v2/profile): multipart/form-data with a perfetto.proto attachment.

Key Fields

| What to check | Field path |

|---|---|

| Event source | URL path in the curl command |

| Log message | message |

| RUM app ID | application_id |

| Session | session_id |

| View | view.id |

| User | usr.id, usr.anonymous_id |

| Tags | ddtags |

| Build variant | ddtags contains flavor:us1,build_type:debug |

Common Mistakes

| Mistake | Fix |

|---|---|

| No Curl logs appear | CurlInterceptor only runs when BuildConfig.DEBUG = true; confirm you're on a debug build |

| Curl logs show but body is '' | printBody = false (default) — change to CurlInterceptor(printBody = true) and rebuild |

| rumApplicationId is empty in payload | config/us1.json was created after last build — rebuild + reinstall |

| Activity class does not exist error | Wrong activity name; run dumpsys package to find the correct one |

| Logcat shows no events after launch | Wait ~15 seconds for the first upload cycle; SDK batches before sending |

| 401 errors on feature flags | Expected with fake credentials — logs/RUM/traces still emit and batch locally |

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take datadog/android-sdk-event-inspection from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.