Summary

Worker query tracing captures execution data for queries running on worker nodes. Tracing is scoped to a quota key, which identifies a group of queries associated with a specific user or client. Use tracing to diagnose slow queries, unexpected resource consumption, or inconsistent query behavior across workers.

The enableWorkerQueryTracing() mutation activates query tracing for all queries associated with a given quota key. Tracing stops automatically at the expiry time you specify. To stop tracing before expiry, use disableWorkerQueryTracing(). The mutation returns a non-null Boolean! indicating whether the operation succeeded.

API Stability Short-Term

Syntax

graphql
enableWorkerQueryTracing(
      input: EnableWorkerQueryTracingInputType!
   ): Boolean!

The mutation accepts a required input argument of type EnableWorkerQueryTracingInputType. Provide the quota key to trace and the datetime at which tracing stops automatically. The mutation returns a non-null Boolean! indicating whether the operation succeeded.

Example

Raw
graphql
mutation {
  enableWorkerQueryTracing (input:
    { quotaKey: "abc123",
      expiry: "2025-06-12T00:00:00Z"
    } )
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  enableWorkerQueryTracing (input:
    { quotaKey: \"abc123\",
      expiry: \"2025-06-12T00:00:00Z\"
    } )
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  enableWorkerQueryTracing (input:
    { quotaKey: \"abc123\",
      expiry: \"2025-06-12T00:00:00Z\"
    } )
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "mutation { ^
  enableWorkerQueryTracing (input: ^
    { quotaKey: \"abc123\", ^
      expiry: \"2025-06-12T00:00:00Z\" ^
    } ) ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  enableWorkerQueryTracing (input:
    { quotaKey: \"abc123\",
      expiry: \"2025-06-12T00:00:00Z\"
    } )
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $query = "mutation {
  enableWorkerQueryTracing (input:
    { quotaKey: \"abc123\",
      expiry: \"2025-06-12T00:00:00Z\"
    } )
}";
$query =~ s/\n/ /g;
my $json = sprintf('{"query" : "%s"}',$query);
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "mutation {
  enableWorkerQueryTracing (input:
    { quotaKey: \"abc123\",
      expiry: \"2025-06-12T00:00:00Z\"
    } )
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "mutation {
  enableWorkerQueryTracing (input:
    { quotaKey: \"abc123\",
      expiry: \"2025-06-12T00:00:00Z\"
    } )
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL',
  path: 'graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "enableWorkerQueryTracing": true
  }
}

Input Parameters

Provide the quota key that identifies the queries to trace, and the expiry datetime at which tracing stops automatically. The expiry field accepts an ISO 8601 UTC datetime string, for example 2025-06-12T00:00:00Z. Choose an expiry that covers the expected duration of the issue you want to diagnose.

Table: EnableWorkerQueryTracingInputType Input Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
Some input parameters may be required, as indicated in the Required column. For return values, this indicates that you are assured a value if the field is requested for the results. 
Table last updated: Oct 14, 2026 
expiryDateTimeyes Preview The end timestamp for tracing. Tracing for this quota key will be disabled automatically once this time is reached. Will be clamped to be at most 15 minutes in the future.
quotaKeyStringyes Preview The quota key for which to enable tracing. All queries belonging to this quota key will be traced.