Skip to content

run-aci: Artillery Cloud dashboard shows 0 workers despite successful distributed test execution #3691

@kbalachander

Description

@kbalachander

Description

When running distributed load tests via artillery run-aci, Artillery Cloud dashboard consistently shows 0 workers during and after test execution. All other metrics (response times, status codes, VU counts, per-endpoint breakdowns) are reported correctly. Only the worker count metadata is missing.

Artillery Version: 2.0.29 (latest)

Steps to Reproduce

  1. Configure Azure ACI with service principal + storage account
  2. Run:
    npx artillery run-aci \
      --count 5 \
      --region uaenorth \
      --record \
      --key "$ARTILLERY_CLOUD_API_KEY" \
      tests/my-test.yml
  3. Open the Run URL in Artillery Cloud dashboard

Expected: Dashboard shows 5 workers
Actual: Dashboard shows 0 workers (metrics are correctly aggregated)

Evidence

Three test runs all show 0 workers despite successful completion:

Test --count VUs Completed Workers Shown
Health Check 1 20 0
Broker API 5 16,950 0
Identity API 3 5,130 0

Root Cause Analysis

Investigation of the source code identified two issues:

1. WORKER_ID env var mismatch (lib/platform/az/aci.js + lib/platform/cloud/cloud.js)

The ACI platform sets WORKER_ID_OVERRIDE on containers, but the Cloud plugin checks for WORKER_ID:

// aci.js - sets WORKER_ID_OVERRIDE
{ name: 'WORKER_ID_OVERRIDE', value: workerId }

// cloud.js - checks WORKER_ID
const enabledInCloudWorker =
  typeof process.env.WORKER_ID !== 'undefined' &&
  typeof process.env.ARTILLERY_CLOUD_API_KEY !== 'undefined';

The bash wrapper script (loadgen-worker) converts WORKER_ID_OVERRIDE to WORKER_ID, but this happens after Node.js has already evaluated process.env.WORKER_ID as undefined. Workers never register with Artillery Cloud.

2. Missing worker count in ACI metadata (lib/platform/az/aci.js)

The ACI platform emits metadata without the count field:

// aci.js (lines 355-362) - no count field
const metadata = { region: this.region, platformConfig: { memory, cpu } };

While run.js correctly includes it:

// run.js - includes count
metadata: { count: runnerOpts.count || Number(flags.count), ... }

Suggested Fix

Fix 1: Add WORKER_ID alongside WORKER_ID_OVERRIDE in container env vars:

{ name: 'WORKER_ID', value: workerId }

Fix 2: Include count in ACI metadata:

const metadata = { region: this.region, count: this.count, platformConfig: { memory, cpu } };

Environment

  • Node.js: v25.3.0
  • OS: Linux (Ubuntu)
  • Azure Region: UAE North
  • ACI containers provisioned successfully, metrics aggregation works correctly

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions