Managing the Trace Results
The trace.sh script that initiates selective trace process resides in /usr/local/bin/ of the Tracing Pod that you have configured.
See Configuring the Trace Microservice Pod for procedure to set up a pod.
-
To specify the audit ID tracing, use the following configuration:
kubectl -n pcf exec -it traceid-pcf-pcf-engine-app-pcf-75b6dc6c4-hc7qc -- trace.sh -i specific_id
Specifying the -i argument for a specific ID causes a real-time policy trace to be generated while the script is running. You can redirect this to a specific output file using standard Linux commands.
-
To dump all traces for the specific audit ID, use the following configuration:
kubectl -n pcf exec -it traceid-pcf-pcf-engine-app-pcf-75b6dc6c4-hc7qc -- trace.sh -x specific_id
Specifying the -x argument with a specific ID, dumps all historical traces for a given ID. You can redirect this to a specific output file using standard Linux commands.
-
To trace all, use the following configuration:
kubectl -n pcf exec -it traceid-pcf-pcf-engine-app-pcf-75b6dc6c4-hc7qc – trace.sh -a
Specifying the -a argument causes all traces to output in the real-time policy trace while the script is running. You can redirect this to a specific output file using standard Linux commands.
-
To trace all the errors, use the following configuration:
kubectl -n pcf exec -it traceid-pcf-pcf-engine-app-pcf-75b6dc6c4-hc7qc -- trace.sh -e
Specifying the -e argument causes all traces that are triggered by an error to output in real-time policy trace while the script is running. You can redirect this to a specific output file using standard Linux commands.
Example output:kubectl -n pcf exec -it traceid-pcf-pcf-engine-app-pcf-75b6dc6c4-hc7qc -- trace.sh -s mongo-admin-0 -p 27017 -t admin -d policy_trace -x 1234567890
-
Execute the trace.sh script with -h arguments to produce a help text describing the capabilities of the script as follows:
kubectl -n pcf exec -it traceid-pcf-pcf-engine-app-pcf-75b6dc6c4-hc7qc -- trace.sh -h /usr/local/bin/trace.sh: option requires an argument -- h usage: /usr/local/bin/trace.sh -i specific_id /usr/local/bin/trace.sh -x specific_id /usr/local/bin/trace.sh -a /usr/local/bin/trace.sh -e /usr/local/bin/trace.sh -s mongo_service_name /usr/local/bin/trace.sh -p mongo_service_port /usr/local/bin/trace.sh -t mongo_replica_set /usr/local/bin/trace.sh -d mongo_database_name /usr/local/bin/trace.sh -h This script starts a selectve trace and outputs it to standard out. 1. Specific Audit Id Tracing /usr/local/bin/trace.sh -i specific_id 2. Dump All Traces for Specific Audit Id /usr/local/bin/trace.sh -x specific_id 3. Trace All /usr/local/bin/trace.sh -a 4. Trace All Errors /usr/local/bin/trace.sh -e 5. K8 mongo service name -s (default: mongo-admin-0) 6. Mongo port -p (default: 27017) 7. Replica set name -t (default: admin) 8. Trace database name -d (default: policy_trace) 9. /usr/local/bin/trace.sh -h displays this help