# Extended Data Collection

By default, the yc-360 script captures essential performance diagnostics, like GC logs, thread dumps, and CPU/memory stats. However, in some cases, you may need to collect custom diagnostic data that is specific to the application or infrastructure (e.g., database snapshots, internal monitoring logs, or network traces).

To support this, the yc-360 script allows users to plug in a custom script to collect any additional artifacts. This is done through the Extended Data (ED) Collection feature, using two arguments:

  • edScript: Path to the custom script to run.
  • edDataFolder: Folder where the custom script outputs its files.

# How to Configure Extended Data Collection

# 1. Define the Custom Script

Write your script to collect any extra data you need.

# Requirements

  • The script must be executable.
  • It must write all its output files to a specific folder: edDataFolder.

# Sample Custom Script: capture-db-logs.sh

#!/bin/bash
OUTPUT_DIR=$1  # Will be passed as argument by the yc-360 script

echo "Collecting DB metrics..." > "$OUTPUT_DIR/db-metrics.txt"
psql -U myuser -c "SELECT * FROM pg_stat_activity;" >> "$OUTPUT_DIR/db-metrics.txt"

echo "Capturing system properties..." > "$OUTPUT_DIR/system-properties.txt"
env >> "$OUTPUT_DIR/system-properties.txt"
1
2
3
4
5
6
7
8

Make it executable:

chmod +x /home/user/capture-db-logs.sh
1

# 2. Set Up Configuration

There are two ways to configure -edScript and -edDataFolder arguments:

# Method 1: CLI Mode

Select your environment below to see how to pass edScript and edDataFolder arguments in CLI:

    # Method 2: YAML Configuration Mode

    Select your environment below to see how to pass edScript and edDataFolder arguments in YAML configuration file:

      # 3. Run the yc-360 Script

      Select your environment below to see the command to run the script:

        INFO

        {PID}: This is the process ID of your Java application. Not sure how to find process Id? Learn here (opens new window). Alternatively, you can pass Unique Token that will uniquely identify the process in container. What is Unique Token?

        NOTE

        Before running the yc-360-Script, remove any existing files in the edFolderPath directory to prevent duplicate data processing.

        # How Captured Extended Data Is Displayed on the Server Side?

        You can download the captured files either individually or as a complete bundle. To see how the captured extended data appears on the server side, click here.