# Tracing ## Introduction Argo Workflows supports distributed tracing using the OpenTelemetry protocol. ## Beta Tracing is not considered finished, it is likely to change in incompatible ways in future minor releases of workflows. For example: we'd like to adopt OpenTelemetry Semantic Conventions. Feedback is very welcome on how this is useful or how it could be made more useful. Spans that start in one workflow controller and end in a different workflow controller (because the controller has restarted) will be incomplete. There is ongoing work to define how to manage long-running spans like this. ## Configuration Tracing is configured via OpenTelemetry environment variables. See [Telemetry Configuration](telemetry-configuration.md#tracing) for setup details. ## Spans ### Trace: `RunAgentTask` ```mermaid flowchart TD RunAgentTask[run_agent_task] ``` ### Trace: `RunWorkerTask` ```mermaid flowchart TD RunWorkerTask[run_worker_task] CaptureScriptResult[capture_script_result] CreateTaskResult[create_task_result] LoadArtifacts[load_artifacts] PatchTaskResult[patch_task_result] SaveArtifacts[save_artifacts] SaveLogs[save_logs] StageFiles[stage_files] LoadArtifact[load_artifact] SaveArtifact[save_artifact] SaveContainerLogs[save_container_logs] UnarchiveArtifact[unarchive_artifact] ArchiveArtifact[archive_artifact] RunWorkerTask --> CaptureScriptResult RunWorkerTask --> CreateTaskResult RunWorkerTask --> LoadArtifacts RunWorkerTask --> PatchTaskResult RunWorkerTask --> SaveArtifacts RunWorkerTask --> SaveLogs RunWorkerTask --> StageFiles LoadArtifacts --> LoadArtifact SaveArtifacts --> SaveArtifact SaveLogs --> SaveContainerLogs LoadArtifact --> UnarchiveArtifact SaveArtifact --> ArchiveArtifact ``` ### Trace: `StartupController` ```mermaid flowchart TD StartupController[startup_controller] StartupCacheSync[startup_cache_sync] StartupController --> StartupCacheSync ``` ### Trace: `Workflow` ```mermaid flowchart TD Workflow[workflow] Node[node] NodePhase[node_phase] PersistUpdates[persist_updates] ReconcileWorkflow[reconcile_workflow] TryAcquireLock[try_acquire_lock] WorkflowPhase[workflow_phase] CreateWorkflowPod[create_workflow_pod] PodReconciliation[pod_reconciliation] ReconcileTaskResults[reconcile_task_results] RunInitContainer[run_init_container] RunMainContainer[run_main_container] RunSupervisorContainer[run_supervisor_container] RunWaitContainer[run_wait_container] RunWorkload[run_workload] SaveArtifacts[save_artifacts] SaveLogs[save_logs] StageFiles[stage_files] WaitWorkload[wait_workload] CaptureScriptResult[capture_script_result] CreateTaskResult[create_task_result] LoadArtifacts[load_artifacts] PatchTaskResult[patch_task_result] ProcessDataTemplate[process_data_template] ReconcileTaskResult[reconcile_task_result] SaveArtifact[save_artifact] SaveContainerLogs[save_container_logs] ArchiveArtifact[archive_artifact] LoadArtifact[load_artifact] UnarchiveArtifact[unarchive_artifact] Workflow --> Node Node --> NodePhase Workflow --> PersistUpdates Workflow --> ReconcileWorkflow Workflow --> TryAcquireLock Workflow --> WorkflowPhase Node --> CreateWorkflowPod ReconcileWorkflow --> PodReconciliation ReconcileWorkflow --> ReconcileTaskResults CreateWorkflowPod --> RunInitContainer CreateWorkflowPod --> RunMainContainer CreateWorkflowPod --> RunSupervisorContainer CreateWorkflowPod --> RunWaitContainer RunMainContainer --> RunWorkload RunWaitContainer --> SaveArtifacts RunSupervisorContainer --> SaveArtifacts RunWaitContainer --> SaveLogs RunSupervisorContainer --> SaveLogs RunInitContainer --> StageFiles RunSupervisorContainer --> StageFiles RunWaitContainer --> WaitWorkload RunSupervisorContainer --> WaitWorkload RunWaitContainer --> CaptureScriptResult RunSupervisorContainer --> CaptureScriptResult RunWaitContainer --> CreateTaskResult RunMainContainer --> CreateTaskResult RunSupervisorContainer --> CreateTaskResult RunInitContainer --> LoadArtifacts RunSupervisorContainer --> LoadArtifacts RunWaitContainer --> PatchTaskResult RunMainContainer --> PatchTaskResult RunSupervisorContainer --> PatchTaskResult RunMainContainer --> ProcessDataTemplate ReconcileTaskResults --> ReconcileTaskResult SaveArtifacts --> SaveArtifact SaveLogs --> SaveContainerLogs SaveArtifact --> ArchiveArtifact LoadArtifacts --> LoadArtifact LoadArtifact --> UnarchiveArtifact ``` ### Span Reference #### `archive_artifact` The compression stage of artifact saving. This span has no attributes. #### `capture_script_result` Capturing script output as a result. This span has no attributes. #### `create_task_result` Creating the WorkflowTaskResult. | attribute | explanation | |-------------------|----------------------------------------------------| | `marks_completed` | True if this write marks the task result completed | #### `create_workflow_pod` Creating a workflow pod for a node. | attribute | explanation | |-----------|----------------------------------| | `node_id` | The unique ID of a node in a DAG | #### `load_artifact` Load one artifact. | attribute | explanation | |-----------|-------------------------------------------| | `path` | Local path for artifact being transferred | #### `load_artifacts` Load the artifacts. This span has no attributes. #### `node` One node in the DAG of a workflow. | attribute | explanation | |-------------|---------------------------------------| | `node_id` | The unique ID of a node in a DAG | | `name` | The name of the workflow | | `namespace` | The namespace that the Workflow is in | | `node_type` | The type of the node | #### `node_phase` The phase of one node as observed by the controller in the DAG of a workflow. | attribute | explanation | |----------------------|-------------------------------------------------| | `node_id` | The unique ID of a node in a DAG | | `node_phase` | The phase that the pod's node was in | | `message` (optional) | The message associated with the node at the end | #### `patch_task_result` Patching the WorkflowTaskResult. | attribute | explanation | |-------------------|----------------------------------------------------| | `marks_completed` | True if this write marks the task result completed | #### `persist_updates` Persisting workflow status updates to Kubernetes. This span has no attributes. #### `pod_reconciliation` Reconciling pod statuses with workflow nodes. This span has no attributes. #### `process_data_template` Processing a data template transformation. This span has no attributes. #### `reconcile_task_result` Check a single task result. | attribute | explanation | |-------------|---------------------------------------------| | `name` | The name of the task result | | `completed` | True if the task result is marked completed | #### `reconcile_task_results` Check the task results. This span has no attributes. #### `reconcile_workflow` Reconciliation between actual and desired state for a single workflow. This span has no attributes. #### `run_agent_task` Run one HTTP or plugin task in the agent. The agent pod doesn't use the `executor` configuration, so set `OTEL_EXPORTER_OTLP_ENDPOINT` on its `main` container with `podSpecPatch` to get this span. | attribute | explanation | |-------------|---------------------------------------| | `name` | The name of the workflow | | `namespace` | The namespace that the Workflow is in | #### `run_init_container` Run the init container of a workload. | attribute | explanation | |-------------|---------------------------------------| | `name` | The name of the workflow | | `namespace` | The namespace that the Workflow is in | #### `run_main_container` Run the main container of a workload. | attribute | explanation | |-------------|---------------------------------------| | `name` | The name of the workflow | | `namespace` | The namespace that the Workflow is in | #### `run_supervisor_container` Run the supervisor container of a workload (init-less mode). | attribute | explanation | |-------------|---------------------------------------| | `name` | The name of the workflow | | `namespace` | The namespace that the Workflow is in | #### `run_wait_container` Run the wait container of a workload. | attribute | explanation | |-------------|---------------------------------------| | `name` | The name of the workflow | | `namespace` | The namespace that the Workflow is in | #### `run_worker_task` Run one task's whole flow in a worker process. Workflows never emits this span, because no command runs a worker. | attribute | explanation | |-------------|---------------------------------------| | `name` | The name of the workflow | | `namespace` | The namespace that the Workflow is in | #### `run_workload` This is where your workload will appear if it emits traces. Workflows never emits this span, it's a placeholder to show what happens if you enable open telemetry tracing in your workloads This span has no attributes. #### `save_artifact` Save one artifact. This span has no attributes. #### `save_artifacts` Save all the artifacts. This span has no attributes. #### `save_container_logs` Saving logs for a specific container. | attribute | explanation | |------------------|---------------------------| | `container_name` | The name of the container | #### `save_logs` Saving container logs as artifacts. This span has no attributes. #### `stage_files` Staging script or manifest files for execution. This span has no attributes. #### `startup_cache_sync` Controllers informer caches have been synchronized. This span has no attributes. #### `startup_controller` Controller startup before it starts processing workflows. This span has no attributes. #### `try_acquire_lock` Attempting to acquire a synchronization lock. | attribute | explanation | |-------------|--------------------------------------------| | `lock_name` | ⚠️ The name of the synchronization lock | | `acquired` | Whether the lock was successfully acquired | #### `unarchive_artifact` The decompression stage of artifact loading. | attribute | explanation | |-----------|----------------------------------------------------| | `archive` | Type of archived artifact, one of none, zip or tar | #### `wait_client_rate_limiter` Waiting for the kubernetes client's rate limiter. This span can appear under any active span context (`node`, `reconcileWorkflow`, etc.) since rate limiter waits can occur during various operations. This is controlled by --qps and --burst on the workflow-controller This span has no attributes. #### `wait_workload` Wait for the workload to finish. This span has no attributes. #### `workflow` The trace of the lifetime of a workflow. | attribute | explanation | |-------------|---------------------------------------| | `name` | The name of the workflow | | `namespace` | The namespace that the Workflow is in | #### `workflow_phase` One phase of the lifetime of a workflow. | attribute | explanation | |-----------|-----------------------------------------| | `phase` | The phase that the Workflow has entered |