Skip to main content
Try Tracer in Your AWS Batch Workloads
Use CloudFormation to set up AWS Batch infrastructure for bioinformatics and HPC pipelines.

1. Connect AWS Integration

Open the following link to connect your AWS account automatically to Tracer. This will allow Tracer to monitor your AWS Batch jobs.→ Connect AWS

2. Locate the EC2 LaunchTemplate UserData

In your CloudFormation template, find the UserData field within the Launch Template used by your AWS Batch compute environment.Reference example: CloudFormation Template
Resources:
  NextflowLaunchTemplate:
    Properties:
      LaunchTemplateData:
        UserData: !Base64 |
          #cloud-config
          runcmd:
            - ...

3. Append Tracer install in EC2 Launch Template UserData

Add these commands to the runcmd: section in your UserData:
- curl -sSL https://install.tracer.cloud | sh 
- tracer init --token YOUR_TOKEN_HERE \
     --pipeline-name YOUR_PIPELINE_NAME \
     --pipeline-type YOUR_PIPELINE_TYPE \
     --environment aws_batch \
     --watch-dir="/var/log"
Go to our onboarding to get your own personal token

4. Validate, apply change set, then verify instance

aws cloudformation validate-template \
  --template-body file://YOUR_TEMPLATE.yaml
aws cloudformation create-change-set \
  --stack-name YOUR_STACK_NAME \
  --template-body file://YOUR_TEMPLATE.yaml \
  --change-set-name tracer-userdata-update \
  --capabilities CAPABILITY_NAMED_IAM
aws cloudformation execute-change-set \
  --stack-name YOUR_STACK_NAME \
  --change-set-name tracer-userdata-update

5. Configure Nextflow batch.config with Trace ID

In your Nextflow batch.config file, you need to:
  1. Add a params section to generate a UUID that will be shared across all jobs in the workflow
  2. Add containerOptions in the process section to pass the trace ID as an environment variable to each container
This allows Tracer to correlate all jobs from the same workflow execution.
// 1. Add params section to generate UUID
params {customUUID = java.util.UUID.randomUUID().toString()}

process {executor = 'awsbatch' 
    queue = 'NextflowCPU'
    
// 2. Add containerOptions to pass trace ID to containers
containerOptions = "--env TRACER_TRACE_ID=${params.customUUID}"
    
resourceLabels = ['custom-session-uuid': "${params.customUUID}"]
}

aws {region = 'YOUR_REGION'
  batch 
  {cliPath = '/usr/local/aws-cli/v2/current/bin/aws'}
}

Monitor and Optimize Your Pipeline

Tracer Logo
Watch your pipeline run in the Tracer dashboard
View real-time metrics, resource usage, and performance insights for your pipeline runs.