# Only Capture Mode
In Only-capture Mode, the yc-360 script collects diagnostic data from your database but does not transmit it to the yCrash server. Instead, it packages the collected data into a compressed file and saves it locally in the directory where the script is executed. Use it when the database host can't reach the yCrash server, or when the data must be reviewed before it is shared. You can upload the captured file to the yCrash server later for analysis.
Choose your environment to follow step-by-step instructions:
1. Create a directory for yc-360 script
mkdir -p /opt/workspace/yc-360
cd /opt/workspace/yc-360
2
2. Download the latest yc-360 script
wget https://tier1app.com/dist/ycrash/yc-360-latest.zip
3. Extract the downloaded zip file
unzip yc-360-latest.zip
4. After unzipping, navigate to the linux directory. Inside this directory, select the yc-360 script that matches your server's architecture (amd64 or arm64).
5. Execute yc-360 Script: Run the yc script on Linux Terminal with your target database.
When you execute the below command, the yc-360 script will capture all the database artifacts/logs from the target JVM & host for analysis. Captured artifacts will be compressed into a zip file and stored in the directory where the above command was executed. The zip file will have the name in the format: 'yc-YYYY-MM-DDTHH-mm-ss.zip'. Example: 'yc-2024-09-23T14-02-42.zip'.
For PostgreSQL:
export YC_PG_PASSWORD='{PASSWORD}'
./yc -onlyCapture -c yc-config.yaml
2
IMPORTANT TIP:
For PostgreSQL:
- Run the yc-360 script on the database host to capture PostgreSQL log information, including deadlocks, timeouts, errors and checkpoint activity.
- Run the script as the
postgresOS user, or grant the user running the script Read access to the PostgreSQL log directory (by default$PGDATA/log). - Ensure sufficient disk space is available to store the captured diagnostic data.
- After the first capture, verify that PostgreSQL log reading works. The capture's
pg_metadata.txtfile should showlog_access,direct.
1. Create a directory for yc-360 script
mkdir -p /opt/workspace/yc-360
cd /opt/workspace/yc-360
2
2. Download the latest yc-360 script
wget https://tier1app.com/dist/ycrash/yc-360-latest.zip
3. Extract the downloaded zip file
unzip yc-360-latest.zip
4. After unzipping, navigate to the mac directory. Inside this directory, select the yc-360 script that matches your server's architecture (amd64 or arm64).
5. Execute yc-360 Script: Run the yc script on Mac Terminal with your target database's process ID.
When you execute the below command, the yc-360 script will capture all the database artifacts/logs from the target JVM & host for analysis. Captured artifacts will be compressed into a zip file and stored in the directory where the above command was executed. The zip file will have the name in the format: 'yc-YYYY-MM-DDTHH-mm-ss.zip'. Example: 'yc-2024-09-23T14-02-42.zip'.
For PostgreSQL:
export YC_PG_PASSWORD='{PASSWORD}'
./yc -onlyCapture -c yc-config.yaml
2
IMPORTANT TIP:
For PostgreSQL:
- Run the yc-360 script on the database host to capture PostgreSQL log information, including deadlocks, timeouts, errors and checkpoint activity.
- Run the script as the
postgresOS user, or grant the user running the script Read access to the PostgreSQL log directory (by default$PGDATA/log). - Ensure sufficient disk space is available to store the captured diagnostic data.
- After the first capture, verify that PostgreSQL log reading works. The capture's
pg_metadata.txtfile should showlog_access,direct.
1. Download: Download the latest version of the yc-360 script from here (opens new window).
2. Extract: Unzip the package and navigate to the windows directory:
3. Execute yc-360 Script from a Command Prompt in that directory:
When the command is executed, the yc-360 script captures all artifacts from the target application and host. The collected artifacts are compressed into a ZIP file and saved in the directory where the command was executed.
The ZIP file is named in the format: yc-YYYY-MM-DDTHH-mm-ss.zip. For example: yc-2024-09-23T14-02-42.zip.
For PostgreSQL:
set YC_PG_PASSWORD={PASSWORD}
yc.exe -onlyCapture -c yc-config.yaml
2
Replace {PASSWORD} with the monitoring user's database password.
Once the capture is completed, the yc-{TIMESTAMP}.zst file is saved in the same directory. You can manually upload this file to the yCrash server for analysis.
IMPORTANT TIP:
- Run the yc-360 script on the database host to capture PostgreSQL log information, including deadlocks, timeouts, errors and checkpoint activity.
- Run the Command Prompt as Administrator, or grant the user running the script Read access to the PostgreSQL log directory (by default
C:\Program Files\PostgreSQL\{VERSION}\data\log). - Ensure sufficient disk space is available to store the captured diagnostic data.
- After the first capture, verify that PostgreSQL log reading works. The capture's
pg_metadata.txtfile should showlog_access,direct.
You can run the yc-360 script in a Docker environment using one of the following approaches, depending on your deployment setup and monitoring preferences.
# 1. Run yc-360 Script in Sidecar Container
Add the yc-360 script as a sidecar container alongside your database container in your Docker Compose or Kubernetes pod spec. The sidecar shares the network namespace with your application, allowing it to connect to the PostgreSQL database.
Docker Compose example:
version: '3.8'
services:
app:
image: myapp:latest
ports: ["8080:8080"]
environment:
- POSTGRES_HOST=db
- POSTGRES_DB=mydb
- POSTGRES_USER=yc_monitor
- POSTGRES_PASSWORD=${YC_PG_PASSWORD}
yc-360:
image: ycrash/yc-360:latest
depends_on: [app]
environment:
- YC_PG_PASSWORD=${YC_PG_PASSWORD}
- PG_HOST=db
- PG_DATABASE=mydb
- PG_USER=yc_monitor
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Run the capture:
docker-compose up yc-360
# 2. Run yc-360 Script in Same Container
Embed the yc-360 script directly inside your application container. This approach requires the script to be included in your Docker image.
Dockerfile example:
FROM python:3.9-slim
# Install yc-360 script
RUN wget https://tier1app.com/dist/ycrash/yc-360-latest.zip && \
unzip yc-360-latest.zip -d /opt/yc-360 && \
chmod +x /opt/yc-360/yc
# Set environment variables for database capture
ENV YC_PG_PASSWORD=${YC_PG_PASSWORD}
ENV PG_HOST=db
ENV PG_DATABASE=mydb
ENV PG_USER=yc_monitor
# Copy YAML config
COPY yc-config.yaml /opt/yc-360/yc-config.yaml
# Run yc-360 script
CMD ["/opt/yc-360/yc", "-c", "/opt/yc-360/yc-config.yaml"]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Build and run:
docker build -t myapp:with-yc-360 .
docker run -d myapp:with-yc-360
2
# 3. Run yc-360 Script on Host
Run the yc-360 script directly on the host machine where Docker containers are running. This approach requires the host to have network access to the PostgreSQL database.
Run the capture:
mkdir -p /opt/workspace/yc-360
cd /opt/workspace/yc-360
wget https://tier1app.com/dist/ycrash/yc-360-latest.zip
unzip yc-360-latest.zip
set YC_PG_PASSWORD={PASSWORD}
yc.exe -onlyCapture -c yc-config.yaml
2
3
4
5
6
IMPORTANT TIP:
- Ensure the host can reach the PostgreSQL database (check network connectivity, security groups, and firewall rules).
- The yc-360 script connects to the database using the provided credentials; make sure the PostgreSQL server accepts connections from the host's IP address.
You can run the yc-360 script in a Kubernetes environment using one of the following approaches, depending on your deployment setup and monitoring preferences.
# 1. Run yc-360 Script as a Sidecar Container
Add the yc-360 script as a sidecar container in your pod spec. The sidecar shares the pod's network namespace with your application, allowing it to connect to the PostgreSQL database.
Pod spec example:
apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
spec:
containers:
- name: myapp
image: myapp:latest
env:
- name: POSTGRES_HOST
value: "db-service.my-namespace.svc.cluster.local"
- name: POSTGRES_DB
value: "mydb"
- name: POSTGRES_USER
value: "yc_monitor"
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: pg-credentials
key: password
- name: yc-360
image: ycrash/yc-360:latest
env:
- name: YC_PG_PASSWORD
valueFrom:
secretKeyRef:
name: pg-credentials
key: password
- name: PG_HOST
value: "db-service.my-namespace.svc.cluster.local"
- name: PG_DATABASE
value: "mydb"
- name: PG_USER
value: "yc_monitor"
volumeMounts:
- name: yc-data
mountPath: /yc-data
command: ["./yc", "-c", "/yc-config/yc-config.yaml"]
volumes:
- name: yc-data
emptyDir: {}
- name: yc-config
configMap:
name: yc-config
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Create the config map:
kubectl create configmap yc-config --from-file=yc-config.yaml
Run the capture:
kubectl apply -f pod.yaml
# 2. Run yc-360 Script in Same Container
Embed the yc-360 script directly inside your application container. This approach requires the script to be included in your Docker image.
Dockerfile example:
FROM postgres:14
# Install yc-360 script
RUN wget https://tier1app.com/dist/ycrash/yc-360-latest.zip && \
unzip yc-360-latest.zip -d /opt/yc-360 && \
chmod +x /opt/yc-360/yc
# Set environment variables for database capture
ENV YC_PG_PASSWORD=${YC_PG_PASSWORD}
ENV PG_HOST=db-host
ENV PG_DATABASE=mydb
ENV PG_USER=yc_monitor
# Copy YAML config
COPY yc-config.yaml /opt/yc-360/yc-config.yaml
# Run yc-360 script
CMD ["/opt/yc-360/yc", "-c", "/opt/yc-360/yc-config.yaml"]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Build and run:
docker build -t mypostgres:with-yc-360 .
kubectl set image deployment/my-postgres my-postgres=mypostgres:with-yc-360
2
IMPORTANT TIP:
- Ensure the Kubernetes pod has network access to the PostgreSQL service.
- If using a ClusterIP service, the yc-360 script can connect using the service name.
- For external databases, ensure the appropriate network policies and security groups allow traffic from the pod's subnet.
To monitor applications running in OpenShift, deploy the yc-360 script using:
Run yc-360 Script in Sidecar Container – Add yc-360 alongside your application within the pod template.
You can run the yc-360 script in an AWS Fargate environment using one of the following approaches, depending on your orchestration platform.
# 1. Fargate on ECS
ECS task definition example:
{
"family": "myapp-task",
"networkMode": "awsvpc",
"requiresCompatibilities": ["FARGATE"],
"cpu": "1024",
"memory": "2048",
"containerDefinitions": [
{
"name": "app",
"image": "myapp:latest",
"environment": [
{ "name": "POSTGRES_HOST", "value": "my-db.example.com" },
{ "name": "POSTGRES_DB", "value": "mydb" },
{ "name": "POSTGRES_USER", "value": "yc_monitor" },
{ "name": "POSTGRES_PASSWORD", "value": "${YC_PG_PASSWORD}" }
]
},
{
"name": "yc-360",
"image": "ycrash/yc-360:latest",
"essential": false,
"environment": [
{ "name": "YC_PG_PASSWORD", "value": "${YC_PG_PASSWORD}" },
{ "name": "PG_HOST", "value": "my-db.example.com" },
{ "name": "PG_DATABASE", "value": "mydb" },
{ "name": "PG_USER", "value": "yc_monitor" }
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/myapp",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "yc-360"
}
}
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Run the capture:
Deploy the task definition through the AWS Console, CLI, or CDK. The yc-360 sidecar will capture PostgreSQL metrics for the configured duration and upload the data to the yCrash server.
IMPORTANT TIP:
- Ensure the Fargate task has the necessary IAM permissions to send data to the yCrash server.
- The sidecar container shares the ENI with the application container, allowing it to connect to the PostgreSQL database using the service hostname or IP address.
- Set the
captureDurationandfrequencyin the YAML configuration to control the capture window and sampling frequency.