Observability in OpenShift Pipelines Red Hat OpenShift Pipelines 1.15 Observability features of OpenShift Pipelines Red Hat OpenShift Documentation Team

Commands:
results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed
results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/e9c736db-5665-441f-922f-7c1d65c9d621
oc get pipelinerun <cr_name> -o yaml
kind: PipelineRun spec: params: - name: message value: five timeouts: pipeline: 1h0m0s pipelineRef: name: echo-pipeline taskRunTemplate: serviceAccountName: pipeline status: startTime: "2023-08-07T11:41:40Z" conditions: - type: Succeeded reason: Succeeded status: "True" message: 'Tasks Completed: 1 (Failed: 0, Cancelled 0), Skipped: 0' lastTransitionTime: "2023-08-07T11:41:49Z" pipelineSpec: tasks: - name: echo-task params: - name: message value: five taskRef: kind: Task name: echo-task-pipeline params: - name: message type: string completionTime: "2023-08-07T11:41:49Z" childReferences: - kind: TaskRun name: echo-pipeline-run-gmzrx-echo-task apiVersion: tekton.dev/v1 pipelineTaskName: echo-task metadata: uid: 62c3b02e-f12b-416c-9771-c02af518f6d4 name: echo-pipeline-run-gmzrx labels: tekton.dev/pipeline: echo-pipeline namespace: releasetest-js5tt finalizers: - chains.tekton.dev/pipelinerun generation: 2 annotations: results.tekton.dev/log: releasetest-js5tt/results/62c3b02e-f12b-416c-9771-c02af518f6d4/logs/c1e49dd8-d641-383e-b708-e3a02b6a4378 chains.tekton.dev/signed: "true" results.tekton.dev/record: releasetest-js5tt/results/62c3b02e-f12b-416c-9771-c02af518f6d4/records/62c3b02e-f12b-416c-9771-c02af518f6d4 results.tekton.dev/result: releasetest-js5tt/results/62c3b02e-f12b-416c-9771-c02af518f6d4 generateName: echo-pipeline-run- managedFields: - time: "2023-08-07T11:41:39Z" manager: kubectl-create fieldsV1: f:spec: .: {} f:params: {} f:pipelineRef: .: {} f:name: {} f:metadata: f:generateName: {} operation: Update apiVersion: tekton.dev/v1 fieldsType: FieldsV1 - time: "2023-08-07T11:41:40Z" manager: openshift-pipelines-controller fieldsV1: f:metadata: f:labels: .: {} f:tekton.dev/pipeline: {} operation: Update apiVersion: tekton.dev/v1 fieldsType: FieldsV1 - time: "2023-08-07T11:41:49Z" manager: openshift-pipelines-chains-controller fieldsV1: f:metadata: f:finalizers: .: {} v:"chains.tekton.dev/pipelinerun": {} f:annotations: .: {} f:chains.tekton.dev/signed: {} operation: Update apiVersion: tekton.dev/v1 fieldsType: FieldsV1 - time: "2023-08-07T11:41:49Z" manager: openshift-pipelines-controller fieldsV1: f:status: f:startTime: {} f:conditions: {} f:pipelineSpec: .: {} f:tasks: {} f:params: {} f:completionTime: {} f:childReferences: {} operation: Update apiVersion: tekton.dev/v1 fieldsType: FieldsV1 subresource: status - time: "2023-08-07T11:42:15Z" manager: openshift-pipelines-results-watcher fieldsV1: f:metadata: f:annotations: f:results.tekton.dev/log: {} f:results.tekton.dev/record: {} f:results.tekton.dev/result: {} operation: Update apiVersion: tekton.dev/v1 fieldsType: FieldsV1 resourceVersion: "126429" creationTimestamp: "2023-08-07T11:41:39Z" deletionTimestamp: "2023-08-07T11:42:23Z" deletionGracePeriodSeconds: 0 apiVersion: tekton.dev/v1
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/CN=tekton-results-api-service.openshift-pipelines.svc.cluster.local" -addext "subjectAltName = DNS:tekton-results-api-service.openshift-pipelines.svc.cluster.local"
oc create secret tls -n openshift-pipelines tekton-results-tls --cert=cert.pem --key=key.pem
oc create secret generic tekton-results-postgres --namespace=openshift-pipelines --from-literal=POSTGRES_USER=result --from-literal=POSTGRES_PASSWORD=USD(openssl rand -base64 20)
oc create secret generic tekton-results-postgres --namespace=openshift-pipelines --from-literal=POSTGRES_USER=<user> \ 1 --from-literal=POSTGRES_PASSWORD=<password> 2
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: tekton-logs spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi
oc apply -n openshift-pipelines -f pvc.yaml
oc create secret generic gcs-credentials --from-file=USDHOME/.config/gcloud/application_default_credentials.json -n openshift-pipelines
apiVersion: v1 kind: Secret metadata: name: my_custom_secret namespace: tekton-pipelines type: Opaque stringData: S3_BUCKET_NAME: bucket1 1 S3_ENDPOINT: https://example.localhost.com 2 S3_HOSTNAME_IMMUTABLE: "false" S3_REGION: region-1 3 S3_ACCESS_KEY_ID: "1234" 4 S3_SECRET_ACCESS_KEY: secret_key 5 S3_MULTI_PART_SIZE: "5242880"
oc create secret generic s3-credentials --from-file=s3_secret.yaml -n openshift-pipelines
apiVersion: operator.tekton.dev/v1alpha1 kind: TektonResult metadata: name: result spec: targetNamespace: openshift-pipelines logs_api: true log_level: debug db_port: 5432 db_host: tekton-results-postgres-service.openshift-pipelines.svc.cluster.local logs_path: /logs logs_type: File logs_buffer_size: 32768 auth_disable: true db_enable_auto_migration: true server_port: 8080 prometheus_port: 9090
logging_pvc_name: tekton-logs
gcs_creds_secret_name: gcs-credentials gcs_creds_secret_key: application_default_credentials.json 1 gcs_bucket_name: bucket-name 2
secret_name: s3-credentials
db_host: postgres.internal.example.com 1 db_port: 5432 2 is_external_db: true
oc apply -n openshift-pipelines -f result.yaml
oc create route -n openshift-pipelines passthrough tekton-results-api-service --service=tekton-results-api-service --port=8080
export RESULTS_API=USD(oc get route tekton-results-api-service -n openshift-pipelines --no-headers -o custom-columns=":spec.host"):443
oc create token <service_account>
address: <tekton_results_route> 1 token: <authentication_token> 2 ssl: roots_file_path: /home/example/cert.pem 3 server_name_override: tekton-results-api-service.openshift-pipelines.svc.cluster.local 4 service_account: namespace: service_acc_1 5 name: service_acc_1 6
opc results list --addr USD{RESULTS_API} <namespace_name>
opc results list --addr USD{RESULTS_API} results-testing
Name Start Update results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed 2023-06-29 02:49:53 +0530 IST 2023-06-29 02:50:05 +0530 IST results-testing/results/ad7eb937-90cc-4510-8380-defe51ad793f 2023-06-29 02:49:38 +0530 IST 2023-06-29 02:50:06 +0530 IST results-testing/results/d064ce6e-d851-4b4e-8db4-7605a23671e4 2023-06-29 02:49:45 +0530 IST 2023-06-29 02:49:56 +0530 IST
opc results records list --addr USD{RESULTS_API} <result_name>
opc results records list --addr USD{RESULTS_API} results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed
Name Type Start Update results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/e9c736db-5665-441f-922f-7c1d65c9d621 tekton.dev/v1.TaskRun 2023-06-29 02:49:53 +0530 IST 2023-06-29 02:49:57 +0530 IST results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/5de23a76-a12b-3a72-8a6a-4f15a3110a3e results.tekton.dev/v1alpha2.Log 2023-06-29 02:49:57 +0530 IST 2023-06-29 02:49:57 +0530 IST results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/57ce92f9-9bf8-3a0a-aefb-dc20c3e2862d results.tekton.dev/v1alpha2.Log 2023-06-29 02:50:05 +0530 IST 2023-06-29 02:50:05 +0530 IST results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/e9a0c21a-f826-42ab-a9d7-a03bcefed4fd tekton.dev/v1.TaskRun 2023-06-29 02:49:57 +0530 IST 2023-06-29 02:50:05 +0530 IST results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/04e2fbf2-8653-405f-bc42-a262bcf02bed tekton.dev/v1.PipelineRun 2023-06-29 02:49:53 +0530 IST 2023-06-29 02:50:05 +0530 IST results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/e6eea2f9-ec80-388c-9982-74a018a548e4 results.tekton.dev/v1alpha2.Log 2023-06-29 02:50:05 +0530 IST 2023-06-29 02:50:05 +0530 IST
opc results records get --addr USD{RESULTS_API} <record_name> | jq -r .data.value | base64 -d | xargs -0 python3 -c 'import sys, yaml, json; j=json.loads(sys.argv[1]); print(yaml.safe_dump(j))'
opc results records get --addr USD{RESULTS_API} results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/records/e9c736db-5665-441f-922f-7c1d65c9d621 | jq -r .data.value | base64 -d | xargs -0 python3 -c 'import sys, yaml, json; j=json.loads(sys.argv[1]); print(yaml.safe_dump(j))'
opc results logs get --addr USD{RESULTS_API} <log_record_name> | jq -r .data | base64 -d
opc results logs get --addr USD{RESULTS_API} results-testing/results/04e2fbf2-8653-405f-bc42-a262bcf02bed/logs/e9c736db-5665-441f-922f-7c1d65c9d621 | jq -r .data | base64 -d
opc results list --addr USD{RESULTS_API} --filter="<cel_query>" <namespace-name>
opc results records list --addr USD{RESULTS_API} --filter="<cel_query>" <namespace_name>/result/-
opc results records list --addr USD{RESULTS_API} --filter="<cel_query>" <result_name>
{ "query": { "match": { "kubernetes.flat_labels": { "query": "app_kubernetes_io/managed-by=tekton-pipelines", "type": "phrase" } } } }
{ "query": { "match": { "kubernetes.flat_labels": { "query": "tekton_dev/pipelineRun=", "type": "phrase" } } } }
{ "query": { "match": { "kubernetes.flat_labels": { "query": "tekton_dev/pipeline=", "type": "phrase" } } } }