OpenClaw works with the opentelemetry-instrumentation-openclaw and diagnostics-otel plugins to report the complete trace and runtime metrics of an AI agent to Cloud Monitor 2.0 application monitoring. The opentelemetry-instrumentation-openclaw plugin handles trace reporting, following OpenTelemetry GenAI semantic conventions to generate a structured trace for each request. The diagnostics-otel plugin collects runtime metrics, such as token consumption rate, call QPS, and queue depth in real time. Once enabled, you can view monitoring data for your OpenClaw application in Cloud Monitor 2.0, including the complete trace, model call latency, token consumption details, and tool call details.
Limits
Limit | Description |
OpenClaw version | v26.2.19 or later. Earlier versions do not include the |
Reporting protocol | Only HTTP/Protobuf is supported. HTTP/JSON and gRPC are not supported. |
Data type | Only trace and metric data are supported. Log data is not supported. |
Cloud Monitor service | You have activated Cloud Monitor 2.0 and created a workspace. |
Step 1: Get the installation command
Before installing the plugin, get an installation command from the Cloud Monitor 2.0 console.
Log on to the Cloud Monitor 2.0 console and select your target workspace.
In the navigation pane on the left, click Integration Center.
In the AI Application Observability section, click the OpenClaw card.
In the parameter configuration area, enter an application name, select a connection method as needed, and then click Get next to LicenseKey.
The console generates an installation command based on your configuration. You can click the copy icon in the upper-right corner to copy the command. The command contains endpoint information, such as the Endpoint and LicenseKey. If you plan to perform a manual installation, record the following information:
Parameter
Description
Example
Endpoint
OTLP trace and metric reporting endpoint
https://proj-xtrace-xxx.cn-hangzhou-intranet.log.aliyuncs.com/apm/trace/opentelemetry/v1/traceshttps://proj-xtrace-xxx.cn-hangzhou-intranet.log.aliyuncs.com/apm/trace/opentelemetry/v1/metrics
x-arms-license-key
LicenseKey for data write authentication
d95vgxi0cn@xxxxxx-arms-project
Simple Log Service project name
proj-xtrace-xxx-cn-hangzhoux-cms-workspace
Cloud Monitor 2.0 workspace ID
default-cms-xxx-cn-hangzhouserviceName
The application name.
openclaw-xxx
Step 2: Install and integrate
Method 1: One-click installation (Recommended)
On the machine running OpenClaw, open a terminal, paste the installation command from the previous step, and run it:
curl -fsSL https://arms-apm-cn-hangzhou-pre.oss-cn-hangzhou.aliyuncs.com/opentelemetry-instrumentation-openclaw/install.sh | bash -s -- \
--endpoint "https://<YOUR_ENDPOINT>" \
--x-arms-license-key "<YOUR_LICENSE_KEY>" \
--x-arms-project "<YOUR_PROJECT>" \
--x-cms-workspace "<YOUR_WORKSPACE>" \
--serviceName "<YOUR_SERVICE_NAME>"The installation script automatically performs the following actions:
Checks the environment for Node.js, npm, and the OpenClaw CLI.
Downloads and extracts the
opentelemetry-instrumentation-openclawplugin to the OpenClaw extensions directory.Installs the runtime dependencies for the plugin.
Automatically locates the
diagnostics-otelextension and installs its dependencies if they are not already installed.Updates the
openclaw.jsonfile with configurations for both plugins. For OpenClaw v2026.4.25 and later, it also automatically addshooks.allowConversationAccess: true.Restarts the gateway to apply the new configuration.
The expected output is similar to the following:
[INFO] Checking prerequisites...
[OK] Node.js v24.14.0
[OK] npm 11.9.0
[OK] OpenClaw CLI found
[INFO] Downloading plugin...
[OK] Downloaded
[INFO] Extracting...
[OK] Extracted
[INFO] Installing npm dependencies...
[OK] Dependencies installed
[INFO] Locating diagnostics-otel extension...
[OK] Found diagnostics-otel at: /home/.../extensions/diagnostics-otel
[OK] diagnostics-otel dependencies already present
[INFO] Updating config...
[OK] Config updated
[INFO] Restarting OpenClaw gateway...
[OK] Gateway restarted
════════════════════════════════════════════════════
✅ opentelemetry-instrumentation-openclaw installed successfully!
════════════════════════════════════════════════════Installation parameters
Parameter | Required | Description |
| Yes | The OTLP data reporting endpoint, obtained from the Cloud Monitor 2.0 Integration Center. |
| Yes | The LicenseKey for data write authentication. |
| Yes | The Simple Log Service project name. |
| Yes | The Cloud Monitor 2.0 workspace identifier. |
| Yes | The reported service name, which appears as the application name in the Cloud Monitor 2.0 application list. |
| No | A custom tarball download URL. |
| No | A custom installation directory. |
| No | Disables metric reporting by skipping the |
Method 2: Manual installation
To perform a manual installation, follow these steps.
1. Download and extract plugin
curl -fsSL -o opentelemetry-instrumentation-openclaw.tar.gz https://arms-apm-cn-hangzhou-pre.oss-cn-hangzhou.aliyuncs.com/opentelemetry-instrumentation-openclaw/opentelemetry-instrumentation-openclaw.tar.gz
tar -xzf opentelemetry-instrumentation-openclaw.tar.gz
cd opentelemetry-instrumentation-openclaw
npm install --omit=dev2. Enable diagnostics-otel plugin
openclaw plugins enable diagnostics-otel3. Edit configuration file
Edit the ~/.openclaw/openclaw.json file and add the following configuration. Replace the placeholders with the endpoint information from Step 1.
{
"plugins": {
"allow": ["opentelemetry-instrumentation-openclaw", "diagnostics-otel"],
"load": {
"paths": ["<PATH_TO_OPENTELEMETRY_INSTRUMENTATION_OPENCLAW>"]
},
"entries": {
"opentelemetry-instrumentation-openclaw": {
"enabled": true,
"hooks": {
"allowConversationAccess": true
},
"config": {
"endpoint": "<ENDPOINT>",
"headers": {
"x-arms-license-key": "<YOUR_LICENSE_KEY>",
"x-arms-project": "<YOUR_ARMS_PROJECT>",
"x-cms-workspace": "<YOUR_WORKSPACE_ID>"
},
"serviceName": "<YOUR_SERVICE_NAME>"
}
},
"diagnostics-otel": {
"enabled": true
}
}
},
"diagnostics": {
"enabled": true,
"otel": {
"enabled": true,
"endpoint": "<ENDPOINT>",
"protocol": "http/protobuf",
"headers": {
"x-arms-license-key": "<YOUR_LICENSE_KEY>",
"x-arms-project": "<YOUR_ARMS_PROJECT>",
"x-cms-workspace": "<YOUR_WORKSPACE_ID>"
},
"serviceName": "<YOUR_SERVICE_NAME>",
"traces": false,
"metrics": true,
"logs": false
}
}
}Version compatibility: Thehooks.allowConversationAccesssetting is supported only in OpenClaw v2026.4.25 and later. For earlier versions, remove thehookssection to avoid an "Unrecognized key" error when the gateway starts.
4. Restart the gateway
openclaw gateway restartMethod 3: Container integration
First, select an OpenClaw base image. If you have already built a custom image from the official base image, you can use your custom image. Then, install the OpenClaw observability plugins on top of the base image and rebuild your own OpenClaw image, as shown below:
FROM ghcr.io/openclaw/openclaw:latest
RUN curl -fsSL https://arms-apm-cn-hangzhou-pre.oss-cn-hangzhou.aliyuncs.com/opentelemetry-instrumentation-openclaw/install.sh | bash -s -- \
--endpoint "https://<YOUR_ENDPOINT>" \
--x-arms-license-key "<YOUR_LICENSE_KEY>" \
--x-arms-project "<YOUR_PROJECT>" \
--x-cms-workspace "<YOUR_WORKSPACE>" \
--serviceName "<YOUR_SERVICE_NAME>"This is the same installation script used for the one-click installation.
Then, build a custom OpenClaw image from this Dockerfile and use it in your container environment.
If you need to dynamically configure the reporting endpoint, application name, and other settings for your OpenClaw instance, build your OpenClaw image as follows:
FROM ghcr.io/openclaw/openclaw:latest
RUN curl -fsSL https://arms-apm-cn-hangzhou-pre.oss-cn-hangzhou.aliyuncs.com/opentelemetry-instrumentation-openclaw/install-ack.sh | bash -sThen, when you run the image, set the following environment variables to specify the reporting endpoint, application name, and other information:
Environment variable | Description |
| Your endpoint URL |
| Your LicenseKey |
| Your project |
| Your workspace |
| Your service name |
Configuration parameters
opentelemetry-instrumentation-openclaw
Parameter | Type | Required | Description |
| String | Yes | The OTLP data reporting endpoint, which you can obtain from the Cloud Monitor 2.0 Integration Center. |
| String | Yes | The LicenseKey for identity authentication. |
| String | Yes | The Simple Log Service project for storing trace data. |
| String | Yes | The target Cloud Monitor 2.0 workspace for data reporting. |
| String | Yes | The reported service name, which appears as the application name in the Cloud Monitor 2.0 application list. |
| Boolean | No | Enables the debug log. The default value is |
| Number | No | The maximum number of spans to hold in the buffer before sending them in a batch. The default value is |
| Number | No | Maximum buffer wait time (milliseconds). The default is |
| Boolean | No | Enables W3C Trace Context propagation to correlate upstream and downstream requests. The default value is |
| String[] | No | Injects the |
| Object | No | Specifies custom Resource attributes to inject into the OTel Resource, such as |
| Object | No | Global Span attributes, which are injected into all spans (such as |
Note:hooks.allowConversationAccess: truemust be configured in thehooksfield of the plugin entries (at the same level asconfig). Otherwise, conversation-related hooks will be blocked by the OpenClaw security policy. Only OpenClaw versions >= 2026.4.25 support this field. Do not configure it for earlier versions.
Environment variable fallback
If a configuration field is not set, the plugin reads the value from the corresponding environment variable instead. This method is ideal for container and Kubernetes environments.
Environment variable | Corresponding configuration | Description |
|
| OTLP reporting endpoint |
|
| ARMS LicenseKey |
|
| ARMS project name |
|
| Workspace identifier |
|
| Service name |
|
| Debug log ( |
|
| Custom Resource properties ( |
|
| Global Span Attributes ( |
Priority: Configuration file > Environment variables > Default values.
Important: The OpenClaw gateway runs in daemon mode by default and does not inherit environment variables from the invoking shell. For local development, use the configuration file method. Environment variables are suitable for container environments such as Docker and Kubernetes.
diagnostics-otel
Parameter | Type | Required | Description |
| Boolean | Yes | Specifies whether to enable the diagnostics feature. Set to |
| Boolean | Yes | Specifies whether to enable OpenTelemetry data export. Set to |
| String | Yes | OTLP data reporting endpoint. The plugin automatically appends the |
| String | Yes | Reporting protocol. Currently, only |
| Object | Yes | The authentication headers included in reporting requests. |
| String | Yes | The reported service name should be consistent with the |
| Boolean | Yes | Specifies whether to report trace data. We recommend that you set this to |
| Boolean | Yes | Specifies whether to report metric data. Set this parameter to |
| Boolean | Yes | Specifies whether to report log data. This feature is not currently supported by Cloud Monitor 2.0. We recommend that you set this parameter to |
| Number | No | The trace sampling rate ranges from 0.0 to 1.0 and applies only to the root span. A value of |
| Number | No | The batch data refresh interval, in milliseconds. The minimum value is |
Step 3: Verify installation
Run the following command to check if the plugins are active:
openclaw plugins listThe expected output looks like this:
┌───────────────────┬─────────────────┬──────────┬──────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────┐
│ Name │ ID │ Format │ Status │ Source │ Version │
├───────────────────┼─────────────────┼──────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────┤
│ OpenClaw OTel │ opentelemetry- │ openclaw │ enabled │ ~/.openclaw/extensions/opentelemetry-instrumentation-openclaw/dist/index.js │ 0.1.3-beta │
│ Plugin │ instrumentation │ │ │ Report OpenClaw AI agent execution traces to any OTLP-compatible backend via OpenTelemetry │ │
│ @openclaw/ │ diagnostics- │ openclaw │ enabled │ ~/.openclaw/npm/node_modules/@openclaw/diagnostics-otel/dist/index.js │ 2026.5.6 │
│ diagnostics-otel │ otel │ │ │ │ │
└───────────────────┴─────────────────┴──────────┴──────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────┘Step 4: View monitoring data
After the installation is complete, send a few messages to OpenClaw to trigger agent execution. You can then view the monitoring data reported by OpenClaw in the Cloud Monitor 2.0 console.
Log on to the Cloud Monitor 2.0 console and select your target workspace.
In the left-side navigation pane, choose Application Observability > AI Application Observability.
In the application list, find the service name you configured (for example,
openclaw-gateway).Click the application name or select Trace Analysis to view the trace, token consumption, LLM inputs and outputs, and latency distribution.
Uninstall
To uninstall the plugin, run the following command:
curl -fsSL https://arms-apm-cn-hangzhou-pre.oss-cn-hangzhou.aliyuncs.com/opentelemetry-instrumentation-openclaw/uninstall.sh | bashThe uninstall script automatically cleans up the opentelemetry-instrumentation-openclaw installation directory and all related configurations in openclaw.json. The configuration for diagnostics-otel is also disabled.
Parameter | Description |
| Skips the confirmation prompt. |
| Specifies the plugin installation directory. If not provided, the directory is automatically detected. |
| Uninstall only |
FAQ
No data appears in the console after configuration?
Check the following items in order:
Confirm that your OpenClaw version is v26.2.19 or later. Run
openclaw --versionto verify.Confirm that the gateway has restarted (it restarts automatically after a one-click installation, but requires you to run
openclaw gateway restartfor a manual installation). If the restart fails, you can runopenclaw doctorand then restart the gateway after the issues are fixed.Confirm that the Endpoint URL is correct and reachable over the network. Test connectivity with
curl.Confirm that all three header values (
x-arms-license-key,x-arms-project, andx-cms-workspace) are correctly entered.If the OpenClaw version is 2026.4.25 or later, set
hooks.allowConversationAccesstotruein the plugin configuration to prevent the security policy from blocking conversation-related hooks. If the version is earlier than 2026.4.25, ensure that the configuration does not contain thehooksfield to avoid an "Unrecognized key" error.Note that the default
flushIntervalMsis 60 seconds. For short-lived tasks, wait a few minutes before data appears.
Does integration affect performance?
The impact is minimal. opentelemetry-instrumentation-openclaw uses the batch export mechanism of OpenTelemetry. Span data is buffered in memory and reported in batches at regular intervals, which does not block the normal processing flow of the agent.
Can I install trace reporting only?
Yes. You can add the --disable-metrics parameter during installation to skip the configuration of diagnostics-otel and enable only Trace reporting.
Will traces from different plugins conflict?
No. The installation script sets diagnostics.otel.traces to false by default. The opentelemetry-instrumentation-openclaw component is specifically responsible for reporting traces. No conflicts will occur even if both report simultaneously.
Will the installation overwrite existing configurations?
No. The installation script uses a merge-update strategy—it only updates necessary fields such as endpoint and headers, and leaves your existing configurations for traces, logs, and sampleRate unchanged.
Why is the token consumption always 0?
OpenClaw v2026.3.8 contains a bug that causes incorrect token consumption collection. This bug was fixed in v2026.4.5 and later versions.
Can I use gRPC to report data?
The diagnostics-otel plugin in OpenClaw supports only http/protobuf. If you set grpc, the setting is silently ignored. No error occurs, but the setting has no effect.