Cursor OpenTelemetry export to your own collector
On the Enterprise plan, Cursor sends its usage data, and on request the text of agent conversations, from its own servers to an OpenTelemetry collector you run. This page sets up that collector inside your infrastructure, so the data stays there: a new collector on a virtual machine with Docker Compose, the same on Kubernetes, or the tools your teams already use, from Datadog to Grafana, Elastic, Splunk, ClickHouse and S3. Nothing is installed on developers’ workstations and no Idun code runs on your side: the collector is the official OpenTelemetry image, and this page gives its configuration. Every file and command below was run end to end before publication, with traffic built from Cursor’s Wire Reference; the few points we could not test are named where they come up.
To send the export to Idun’s collection address instead, see the Cursor connector. When the data stays with you, we agree at the start of the audit how Idun Cockpit reads it: read access to the storage, or the Cockpit installed in your infrastructure.
How it works
Section titled “How it works”- Cursor pushes, you receive. Cursor’s servers send OTLP over HTTP, in binary protobuf, to the base address you give them:
POST <base>/v1/logsandPOST <base>/v1/metrics. gRPC and JSON are not used. See Collector recipes in Cursor’s documentation. - From 27 fixed addresses. The traffic leaves Cursor through a proxy with 27 published IP addresses, so your endpoint must be reachable from the internet, over HTTPS. Cursor gives notice before they change.
- With your token. Each request carries the header
Authorization: Bearer <token>. You choose the token, store it in the collector and enter it in Cursor. - The collector decides what is kept. It refuses a request without the right token, drops the people you exclude, writes the rest to files on disk and, if you want, forwards it to your tools.
- No history. Data flows from the moment the export is turned on. Cursor’s Admin API, read separately, gives past usage and cost.
Before you start
Section titled “Before you start”| What | Why | How to check |
|---|---|---|
| The Cursor Enterprise plan | OpenTelemetry Export is an Enterprise feature. | A team admin sees Team Settings > OpenTelemetry Export in the Cursor dashboard. |
| A team not in Privacy Mode (Legacy) | In that mode, conversation content cannot be exported. | On the same page, Allow conversation content export is not greyed out. |
| A team admin | They create the destination in Cursor. | Their role in the dashboard’s member list. |
| A public HTTPS name | Cursor connects from the internet. | For example otel.example.com, resolving to your reverse proxy. |
| A certificate the public trusts | Cursor must be able to verify it. | Let’s Encrypt, or a public certificate authority. An internal authority is not enough. |
| Port 443 open to Cursor’s 27 addresses | The only inbound traffic needed. | Your firewall rule, or the allowlist of the reverse proxy below. |
| A host for the collector | A Linux VM with Docker Compose, or a Kubernetes cluster. | 1 vCPU and 2 GB of memory for the collector; disk to size during the first week. |
| Developers informed | The export can send the text of their requests. | See Usage, not individuals. |
Choose your setup
Section titled “Choose your setup”| Setup | Choose it when |
|---|---|
| A collector on a virtual machine | You want the simplest start: one VM, Docker Compose, files on disk. |
| Kubernetes | Your services run on Kubernetes. The same collector, through the official Helm chart. |
| Your existing tools | Your teams already read logs and metrics in Datadog, Grafana, Elastic, Splunk, ClickHouse or S3. The collector forwards to them and keeps a copy on disk. |
The three share the same collector configuration. Start with the first section even if you choose another: it explains each setting once.
A collector on a virtual machine
Section titled “A collector on a virtual machine”Three files in one folder: docker-compose.yml starts the official image, config.yaml tells the collector what to do, .env holds the token and the list of excluded people. Tested on a Linux virtual machine with Docker Engine 29 and Compose 5.
-
Create the folder and copy the three files
On the VM, create a folder, for example
~/cursor-otel, and put in it the three files below, unchanged. -
Write the token into
.envFenêtre de terminal cp .env.example .env && chmod 600 .env &&sed -i.bak '/^CURSOR_OTLP_TOKEN=$/d' .env && rm .env.bak &&printf 'CURSOR_OTLP_TOKEN=%s\n' "$(openssl rand -hex 32)" >>.envKeep this token: you will enter it in Cursor. Read it with
grep '^CURSOR_OTLP_TOKEN=' .env. -
Start the collector
Fenêtre de terminal sudo docker compose up -dA first task gives the
data/folder to the collector’s user, then the collector starts.sudo docker compose psshows ithealthyafter about ten seconds.
With a proxy or a tool, declare your Compose files once. The next sections add a second Compose file, sometimes a third. List them all in .env, with COMPOSE_FILE, as .env.example shows: every sudo docker compose command of this page then uses the same files. Without it, the next sudo docker compose up -d restarts the collector without the extra files, and forwarding to your tool stops without an error.
# OpenTelemetry Collector for the Cursor OTLP export, on a VM with Docker Compose.# Start: cp .env.example .env, fill in .env, then: docker compose up -d# Data lands in ./data (JSON Lines).
services: # One-off setup task, which exits right away: # - gives ./data and its content to user 10001, the user of the collector image; # the folder gets mode 0700; # - copies busybox for the health check (the collector image has no shell and no curl). prepare: image: busybox:1.38.0-musl@sha256:80e38f9a1b39188b8bdb28879178edb322a4402b081a9aedda1924609decd6f6 command: ["sh", "-c", "chown -R 10001:10001 /data && chmod 0700 /data && cp /bin/busybox /tools/busybox"] volumes: - ./data:/data - tools:/tools restart: "no"
collector: # Version pinned by digest: the same image everywhere, updated only on purpose. image: otel/opentelemetry-collector-contrib:0.166.0@sha256:3e18fe04181de50bdd72e23ad4a4d6214b54351e63d496f1c58127cc4541ad7f user: "10001:10001" command: ["--config=/etc/otelcol/config.yaml"] environment: CURSOR_OTLP_TOKEN: ${CURSOR_OTLP_TOKEN:?set CURSOR_OTLP_TOKEN in .env} # Token rotation: when empty in .env, it takes the value of CURSOR_OTLP_TOKEN. CURSOR_OTLP_TOKEN_NEXT: ${CURSOR_OTLP_TOKEN_NEXT:-${CURSOR_OTLP_TOKEN}} BLOCKED_EMAILS: ${BLOCKED_EMAILS:-} RETENTION_DAYS: ${RETENTION_DAYS:-90} # The Go garbage collector aims at 1,600 MiB, below the container limit (2 GB). GOMEMLIMIT: 1600MiB volumes: - ./config.yaml:/etc/otelcol/config.yaml:ro - ./data:/data - tools:/tools:ro ports: # Local only: the reverse proxy (TLS) sits in front. - "127.0.0.1:${OTLP_PORT:-4318}:4318" - "127.0.0.1:${HEALTH_PORT:-13133}:13133" depends_on: prepare: condition: service_completed_successfully healthcheck: test: ["CMD", "/tools/busybox", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:13133/"] interval: 30s timeout: 5s retries: 3 start_period: 10s restart: unless-stopped read_only: true cap_drop: [ALL] security_opt: ["no-new-privileges:true"] deploy: resources: limits: cpus: "1.0" memory: 2g logging: driver: json-file options: max-size: "10m" max-file: "3"
volumes: tools:# OpenTelemetry Collector for the Cursor OTLP export.# Official otel/opentelemetry-collector-contrib image, no custom component.# Path of a record: receiver -> processors (in order) -> exporter.# No batch processor: the reply to Cursor waits for the write to disk. A 200 means# "written"; a full disk returns 503, and Cursor sends the logs again.
extensions: # Rejects (401) any request without the "Authorization: Bearer <token>" header. # The token comes from the .env file; it is the same as in Cursor. A second token, # CURSOR_OTLP_TOKEN_NEXT, is used during a rotation; without it, the first one is reused. bearertokenauth: scheme: Bearer tokens: - ${env:CURSOR_OTLP_TOKEN} - ${env:CURSOR_OTLP_TOKEN_NEXT:-${env:CURSOR_OTLP_TOKEN}}
# Liveness probe: GET http://<host>:13133/ returns 200 while the collector runs. # Do not expose it on the Internet. health_check: endpoint: 0.0.0.0:13133
receivers: # Cursor sends OTLP/HTTP protobuf to /v1/logs and /v1/metrics. otlp: protocols: http: endpoint: 0.0.0.0:4318 auth: authenticator: bearertokenauth # Maximum size of a request, measured after decompression. Above it, the collector # returns 400 ("request body too large"), and Cursor does not resend a 4xx: # keep a margin (one message is up to 32 KiB). max_request_body_size: 67108864 # 64 MiB # Timeouts: 10 s for the headers, 60 s for the whole request # (defaults: 1 min for the headers, none for the body). read_header_timeout: 10s read_timeout: 60s
processors: # Refuses data (a temporary error, which Cursor resends for logs) before memory # runs out. The percentages apply to the memory limit of the container. memory_limiter: check_interval: 1s limit_percentage: 80 spike_limit_percentage: 25
# Block list: BLOCKED_EMAILS (.env), addresses separated by commas, semicolons or # spaces, case ignored. For these people, logs and metrics are dropped. # If the list is not empty, conversation content without an email (which cannot be # checked) is dropped too. Spaces and ";" are first turned into commas, then split. filter/blocklist: error_mode: ignore log_conditions: - &blocked_email >- resource.attributes["cursor.user.email"] != nil and resource.attributes["cursor.user.email"] != "" and ContainsValue(Split(Concat(Split(Concat(Split(ToLowerCase("${env:BLOCKED_EMAILS}"), " "), ","), ";"), ","), ","), ToLowerCase(resource.attributes["cursor.user.email"])) - >- IsMatch("${env:BLOCKED_EMAILS}", "@") and (resource.attributes["cursor.user.email"] == nil or resource.attributes["cursor.user.email"] == "") and log.attributes["cursor.conversation.provenance"] != nil metric_conditions: - *blocked_email
exporters: # One file per signal, in JSON Lines: one line = one request from Cursor, as OTLP JSON. # Rotation: above max_megabytes, the file is renamed # (cursor-logs-<UTC date>-size.jsonl) and a new one is opened. # max_days: at each rotation, renamed files older than RETENTION_DAYS days # (date read from their name) are deleted. 0: never. Without the variable: 90. # max_backups: 0 = no limit on the number of files. Do not omit it: its default (100) # would delete the oldest files. file/logs: path: /data/cursor-logs.jsonl format: json rotation: max_megabytes: 100 max_days: ${env:RETENTION_DAYS:-90} max_backups: 0 file/metrics: path: /data/cursor-metrics.jsonl format: json rotation: max_megabytes: 100 max_days: ${env:RETENTION_DAYS:-90} max_backups: 0
service: extensions: [bearertokenauth, health_check] pipelines: logs: receivers: [otlp] processors: [memory_limiter, filter/blocklist] exporters: [file/logs] metrics: receivers: [otlp] processors: [memory_limiter, filter/blocklist] exporters: [file/metrics]# Copy this file to .env, then run: chmod 600 .env
# Compose files read by every "docker compose ..." (up, exec, run, restart).# As soon as you add a file (proxy, tool), uncomment the line below and list them all,# separated by ":". Without it, a plain "docker compose up -d" only reads docker-compose.yml,# and the collector loses their settings. With it, a docker-compose.override.yml is only read# if it is in the list.# COMPOSE_FILE=docker-compose.yml:docker-compose.nginx.yml:docker-compose.grafana.yml
# Token that Cursor sends in "Authorization: Bearer <token>".# Generate it with: openssl rand -hex 32# Enter the same value in Cursor (Team Settings > OpenTelemetry Export).CURSOR_OTLP_TOKEN=
# Token rotation, without data loss: 1) put the new token here and run# "docker compose up -d" (both tokens are accepted); 2) enter it in Cursor;# 3) wait a few minutes; 4) copy it into CURSOR_OTLP_TOKEN, empty this line,# and run "docker compose up -d" again. Empty outside a rotation.CURSOR_OTLP_TOKEN_NEXT=
# Block list: addresses for which nothing is kept, separated by commas,# semicolons or spaces. Case does not matter. No double quotes.# Leave empty to keep everything.# Example: BLOCKED_EMAILS=jane.doe@example.com, john.roe@example.comBLOCKED_EMAILS=
# Retention of the files renamed by rotation, in days (0: never deleted).RETENTION_DAYS=90
# Listening ports on the VM (127.0.0.1 only).OTLP_PORT=4318HEALTH_PORT=13133What this configuration does
Section titled “What this configuration does”- The token. The
bearertokenauthextension refuses, with401, any request withoutAuthorization: Bearer <token>. Compose refuses to start while the token is empty, rather than starting a collector that refuses everything. - The size of a request. Up to 64 MiB, measured after decompression. Beyond that the collector answers
400, and Cursor does not retry a4xx: keep the margin. A message is at most 32 KiB. - Memory. The container is limited to 2 GB, and the collector refuses data before reaching it, with a temporary error.
- People left out. The
filter/blocklistprocessor drops what belongs to the addresses listed inBLOCKED_EMAILS. See Leave people out. - The files. One file per signal in
data/, in JSON Lines: each line is one request from Cursor, in OTLP JSON. Past 100 MB, the file is renamed with its date and a new one starts. - No
batchprocessor. Cursor’s minimal example uses one, and so do most collector examples. Here it is left out on purpose: it answers Cursor before the data is written. Without it,200means “written to disk”, and a full disk returns503, a temporary error. - The container. The image is pinned by its digest, runs as user
10001, with a read-only file system, no Linux capabilities, and listens only on127.0.0.1: the reverse proxy sits in front. - What Cursor does with an error. According to its Wire Reference, Cursor replays the logs of a request refused with a temporary error (
5xx, or no answer) for about 7 days. It does not replay metrics, nor a request refused with a4xx. Each restart of the collector refuses connections for a few seconds: the logs come back, the metrics of those seconds are lost.
Expose the collector over HTTPS
Section titled “Expose the collector over HTTPS”The collector listens only on the VM itself. A reverse proxy in front of it carries the certificate, lets in only Cursor’s addresses and accepts requests of 64 MiB. Two tested configurations: nginx or Caddy.
-
Put the certificate in
tls/tls/fullchain.pemandtls/privkey.pem, next todocker-compose.yml. The certificate must be trusted by the public: Cursor connects from the internet. Replaceotel.example.comwith your name innginx/cursor-otel.conforcaddy/Caddyfile. -
Generate the allowlist of Cursor’s addresses
Copy
cursor-ips.txtandmake-allowlist.sh, create thenginx/orcaddy/folder, then runbash make-allowlist.sh. Run it again if Cursor announces a change of address. -
Start the proxy with the collector
Add the overlay file of your choice, below, to
COMPOSE_FILEin.env, for exampleCOMPOSE_FILE=docker-compose.yml:docker-compose.nginx.yml, then runsudo docker compose up -d. -
Reload the proxy after a change
After a new allowlist or a renewed certificate (a Let’s Encrypt certificate lasts 90 days):
Fenêtre de terminal sudo docker compose exec nginx nginx -s reload # nginxsudo docker compose exec caddy caddy reload --config /etc/caddy/Caddyfile # Caddy
# Source IPs of the Cursor OTLP export (Cursor docs "OpenTelemetry Export", Source IPs section, read on 2026-11-26).# Cursor gives notice before changing them. One IP per line; lines starting with # are ignored.3.208.51.1633.209.66.123.218.161.443.224.130.483.231.18.2063.234.118.13218.210.232.13634.197.19.14834.198.251.12034.199.187.24735.170.160.15235.174.159.3544.215.226.8552.44.113.13152.202.172.6954.81.109.21754.204.61.4454.236.99.11967.202.63.191100.63.97.141100.63.144.57184.73.225.134184.193.125.229184.193.223.40184.194.140.210184.194.175.144184.194.208.56#!/usr/bin/env bash# Builds the nginx and Caddy allow lists from cursor-ips.txt.# Run it again when Cursor announces an IP change, then reload the proxy (command printed).# Usage: bash make-allowlist.sh (Cursor IPs only)# bash make-allowlist.sh 203.0.113.7 (adds an IP, for example a test machine)set -euo pipefailcd "$(dirname "$0")"
ips=$( { grep -v '^#' cursor-ips.txt; printf '%s\n' "$@"; } | grep -E '^[0-9]{1,3}(\.[0-9]{1,3}){3}(/[0-9]{1,2})?$' )[ -n "$ips" ] || { echo "no IP read from cursor-ips.txt" >&2; exit 1; }
header="# Generated by make-allowlist.sh from cursor-ips.txt: do not edit by hand."written=""reload=""if [ -d nginx ]; then { echo "$header"; for ip in $ips; do echo "allow $ip;"; done; echo "deny all;"; } >nginx/cursor-allowlist.conf written="$written nginx/cursor-allowlist.conf" reload="$reload docker compose exec nginx nginx -s reload"fiif [ -d caddy ]; then { echo "$header"; echo "@not_cursor_ips not remote_ip" $ips; } >caddy/cursor-allowlist.caddy written="$written caddy/cursor-allowlist.caddy" reload="$reload docker compose exec caddy caddy reload --config /etc/caddy/Caddyfile"fi[ -n "$written" ] || { echo "no nginx/ or caddy/ folder next to this script" >&2; exit 1; }echo "$(echo "$ips" | wc -l | tr -d ' ') IPs written to$written"echo "Reload the running proxy to apply them:$reload"# nginx in front of the collector: HTTPS, Cursor IP list, body size, timeouts.# Only POST /v1/logs and POST /v1/metrics go through; another method on these paths gets 403,# any other path 404.
server { listen 443 ssl; http2 on; server_name otel.example.com; # replace with your domain name
# A publicly trusted certificate (Let's Encrypt, a company CA trusted by browsers...): # Cursor connects from the Internet and must be able to verify it. ssl_certificate /etc/nginx/tls/fullchain.pem; ssl_certificate_key /etc/nginx/tls/privkey.pem; ssl_protocols TLSv1.2 TLSv1.3;
# Body: up to 64 MiB, like max_request_body_size in the collector. # A 413 here is a 4xx, which Cursor does not resend. client_max_body_size 64m; client_body_buffer_size 1m;
# Timeouts client_header_timeout 10s; client_body_timeout 60s; keepalive_timeout 75s; proxy_connect_timeout 5s; proxy_send_timeout 60s; proxy_read_timeout 60s;
# Docker internal DNS, read again every 10 s: if the collector is recreated on another IP, # nginx follows it instead of returning 502. resolver 127.0.0.11 valid=10s; set $collector http://collector:4318;
location ~ ^/v1/(logs|metrics)$ { include /etc/nginx/cursor-allowlist.conf; # allow <Cursor IP>; ... deny all; -> 403 limit_except POST { deny all; }
proxy_pass $collector; proxy_http_version 1.1; # By default nginx passes on the request headers, including Authorization, # Content-Type and Content-Encoding (gzip). The client origin is added. proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; }
location / { return 404; }}# nginx with HTTPS in front of the collector. Put it next to docker-compose.yml.# Add it to COMPOSE_FILE in .env (see .env.example), then: docker compose up -d# Needs: ./tls/fullchain.pem and ./tls/privkey.pem, ./nginx/cursor-allowlist.conf (make-allowlist.sh).
services: nginx: image: nginx:1.30.8-alpine@sha256:8eb04fe3b385090e9aa02961f77398ad09b6bf33ab07f6669a5bb7acce22c0d3 ports: - "${HTTPS_PORT:-443}:443" volumes: - ./nginx/cursor-otel.conf:/etc/nginx/conf.d/default.conf:ro - ./nginx/cursor-allowlist.conf:/etc/nginx/cursor-allowlist.conf:ro - ./tls:/etc/nginx/tls:ro depends_on: collector: condition: service_healthy restart: unless-stopped# Caddy in front of the collector: HTTPS, Cursor IP list, body size, timeouts.# Only POST /v1/logs and POST /v1/metrics go through; another IP gets 403, another path 404.{ servers { timeouts { read_header 10s read_body 60s write 60s idle 2m } }}
# Replace otel.example.com with your domain name.otel.example.com { # A publicly trusted certificate: Cursor connects from the Internet. # Without this line, Caddy tries to get one automatically: the name must point to this server, # reachable from the Internet. Requirements and ports: https://caddyserver.com/docs/automatic-https # (docker-compose.caddy.yml only publishes port 443). tls /etc/caddy/tls/fullchain.pem /etc/caddy/tls/privkey.pem
# Body: up to 64 MiB ("MiB": "MB" would mean 10^6 bytes), like the collector. request_body { max_size 64MiB }
# Defines @not_cursor_ips (any IP missing from cursor-ips.txt), generated by make-allowlist.sh. import /etc/caddy/cursor-allowlist.caddy
@otlp { method POST path /v1/logs /v1/metrics }
# route: the rules apply in the order written. route { respond @not_cursor_ips 403 reverse_proxy @otlp collector:4318 { # Caddy passes on the request headers (Authorization, Content-Encoding...) # and adds X-Forwarded-For. transport http { dial_timeout 5s response_header_timeout 60s } } respond 404 }}# Caddy with HTTPS in front of the collector. Put it next to docker-compose.yml.# Add it to COMPOSE_FILE in .env (see .env.example), then: docker compose up -d# Needs: ./tls/fullchain.pem and ./tls/privkey.pem, ./caddy/cursor-allowlist.caddy (make-allowlist.sh).
services: caddy: image: caddy:2.11.9-alpine@sha256:003a97808e781aa9f7e75cc2f43d34d461099031faf5e20faefb9f61126836f0 ports: - "${HTTPS_PORT:-443}:443" volumes: - ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro - ./caddy/cursor-allowlist.caddy:/etc/caddy/cursor-allowlist.caddy:ro - ./tls:/etc/caddy/tls:ro - caddy-data:/data depends_on: collector: condition: service_healthy restart: unless-stopped
volumes: caddy-data:- Only two paths.
POST /v1/logsandPOST /v1/metricsreach the collector. Any other path gets404, any other address403. The health port, 13133, is never exposed. - 64 MiB, as the collector. nginx refuses bodies over 1 MB by default, with
413, which Cursor does not retry. With Caddy, write64MiB:64MBmeans 64,000,000 bytes. - Behind a load balancer. The proxy then sees the load balancer’s address, not Cursor’s, and refuses everything with
403. Give it the real address first:set_real_ip_fromandreal_ip_headerfor nginx,trusted_proxiesandclient_ipfor Caddy. This case was not part of our tests. - From your own network, the public address answers
403. That is the allowlist working. To test the whole chain from a workstation, add its address for the time of the test:bash make-allowlist.sh 203.0.113.7, then reload the proxy (step 4).
On Kubernetes
Section titled “On Kubernetes”The official Helm chart open-telemetry/opentelemetry-collector, with the same collector configuration, a persistent volume for the files and an Ingress for HTTPS. Tested on Kubernetes 1.37 with chart 0.183.2 and ingress-nginx 1.15.1.
On the cluster you need Helm, an ingress controller of class nginx (or the Gateway API, below), a default StorageClass for the volume, and a public DNS name pointing to the Ingress, with its certificate.
-
Create the namespace, the secrets and the volume
Put
secrets.sh, below, in a folder with your certificate asfullchain.pemandprivkey.pem. Run it a first time: it createscursor-otel.env(mode 600) with a new token, which you will enter in Cursor; fill inBLOCKED_EMAILSthere if needed. Run it a second time: it creates thecursor-otelnamespace and the two secrets, without the token ever appearing on a command line. Then create the volume:Fenêtre de terminal bash secrets.sh # first run: creates cursor-otel.envbash secrets.sh # second run: creates the secretskubectl apply -f pvc.yaml -
Install the chart
Replace
otel.example.comwith your name invalues.yaml(underhostsandtls), then:Fenêtre de terminal helm install cursor-otel opentelemetry-collector \--repo https://open-telemetry.github.io/opentelemetry-helm-charts --version 0.183.2 \--namespace cursor-otel -f values.yaml -
Check it
Run
verify-k8s.sh, below.
# Values for the official Helm chart open-telemetry/opentelemetry-collector (version 0.183.2)# to receive the Cursor OTLP export. Same collector configuration as the Docker Compose setup.## helm install cursor-otel opentelemetry-collector \# --repo https://open-telemetry.github.io/opentelemetry-helm-charts --version 0.183.2 \# --namespace cursor-otel -f values.yaml## Needed in the namespace: the cursor-otel and cursor-otel-tls Secrets (secrets.sh)# and the cursor-otel-data PVC (pvc.yaml).
mode: deployment
# A single replica: the file exporter writes to a ReadWriteOnce volume. Two pods would write# to the same files (or each to its own, and the data would be split in two).replicaCount: 1# Recreate: the old pod stops before the new one opens the files.rollout: strategy: Recreate
image: repository: otel/opentelemetry-collector-contrib tag: "0.166.0" digest: sha256:3e18fe04181de50bdd72e23ad4a4d6214b54351e63d496f1c58127cc4541ad7fcommand: name: otelcol-contrib
# Token, block list and retention, from the cursor-otel Secret (created by secrets.sh from# cursor-otel.env: CURSOR_OTLP_TOKEN, BLOCKED_EMAILS, RETENTION_DAYS, and CURSOR_OTLP_TOKEN_NEXT# during a rotation).extraEnvsFrom: - secretRef: name: cursor-otel
# Persistent volume for the JSON Lines files (see pvc.yaml).extraVolumes: - name: data persistentVolumeClaim: claimName: cursor-otel-dataextraVolumeMounts: - name: data mountPath: /data
podSecurityContext: runAsUser: 10001 runAsGroup: 10001 runAsNonRoot: true fsGroup: 10001 # makes the volume writable by the collector usersecurityContext: readOnlyRootFilesystem: true allowPrivilegeEscalation: false capabilities: drop: [ALL]
resources: requests: cpu: 100m memory: 256Mi limits: cpu: "1" memory: 2Gi # the chart derives GOMEMLIMIT from it (80%)
# Only the OTLP/HTTP port is used; the other chart ports are closed.ports: otlp: enabled: false jaeger-compact: enabled: false jaeger-thrift: enabled: false jaeger-grpc: enabled: false zipkin: enabled: false
# The chart merges this block with its default configuration: the "null" values remove# what the chart adds (Jaeger, Zipkin, Prometheus, gRPC, traces, debug).config: extensions: bearertokenauth: scheme: Bearer tokens: - ${env:CURSOR_OTLP_TOKEN} - ${env:CURSOR_OTLP_TOKEN_NEXT:-${env:CURSOR_OTLP_TOKEN}} health_check: endpoint: 0.0.0.0:13133
receivers: jaeger: null zipkin: null prometheus: null otlp: protocols: grpc: null http: endpoint: 0.0.0.0:4318 auth: authenticator: bearertokenauth max_request_body_size: 67108864 # 64 MiB read_header_timeout: 10s read_timeout: 60s
processors: memory_limiter: check_interval: 1s limit_percentage: 80 spike_limit_percentage: 25 # Block list: see the Docker Compose setup. Separators: comma, semicolon, space. filter/blocklist: error_mode: ignore log_conditions: - &blocked_email >- resource.attributes["cursor.user.email"] != nil and resource.attributes["cursor.user.email"] != "" and ContainsValue(Split(Concat(Split(Concat(Split(ToLowerCase("${env:BLOCKED_EMAILS}"), " "), ","), ";"), ","), ","), ToLowerCase(resource.attributes["cursor.user.email"])) - >- IsMatch("${env:BLOCKED_EMAILS}", "@") and (resource.attributes["cursor.user.email"] == nil or resource.attributes["cursor.user.email"] == "") and log.attributes["cursor.conversation.provenance"] != nil metric_conditions: - *blocked_email batch: null # processor added by default by the chart: removed (see the Docker Compose setup)
exporters: debug: null file/logs: path: /data/cursor-logs.jsonl format: json rotation: max_megabytes: 100 max_days: ${env:RETENTION_DAYS:-90} max_backups: 0 # 0 = no limit; if omitted, it would be 100 file/metrics: path: /data/cursor-metrics.jsonl format: json rotation: max_megabytes: 100 max_days: ${env:RETENTION_DAYS:-90} max_backups: 0 # 0 = no limit; if omitted, it would be 100
service: extensions: [bearertokenauth, health_check] pipelines: traces: null logs: receivers: [otlp] processors: [memory_limiter, filter/blocklist] exporters: [file/logs] metrics: receivers: [otlp] processors: [memory_limiter, filter/blocklist] exporters: [file/metrics]
# HTTPS exposure through ingress-nginx. Only /v1/logs and /v1/metrics are published.ingress: enabled: true ingressClassName: nginx annotations: # Body up to 64 MiB, like the collector (above: 413, which Cursor does not resend). nginx.ingress.kubernetes.io/proxy-body-size: "64m" nginx.ingress.kubernetes.io/proxy-connect-timeout: "5" nginx.ingress.kubernetes.io/proxy-send-timeout: "60" nginx.ingress.kubernetes.io/proxy-read-timeout: "60" # Cursor source IPs (Cursor docs, 2026-11-26). Others get 403. nginx.ingress.kubernetes.io/whitelist-source-range: "3.208.51.163,3.209.66.12,3.218.161.44,3.224.130.48,3.231.18.206,3.234.118.132,18.210.232.136,34.197.19.148,34.198.251.120,34.199.187.247,35.170.160.152,35.174.159.35,44.215.226.85,52.44.113.131,52.202.172.69,54.81.109.217,54.204.61.44,54.236.99.119,67.202.63.191,100.63.97.141,100.63.144.57,184.73.225.134,184.193.125.229,184.193.223.40,184.194.140.210,184.194.175.144,184.194.208.56" hosts: - host: otel.example.com # replace with your domain name paths: - path: /v1/logs pathType: Exact port: 4318 - path: /v1/metrics pathType: Exact port: 4318 tls: - secretName: cursor-otel-tls hosts: - otel.example.com # the same name# Persistent volume for the collector JSON Lines files.# ReadWriteOnce: one node at a time, hence a single collector replica.# Without storageClassName, the cluster default class is used.apiVersion: v1kind: PersistentVolumeClaimmetadata: name: cursor-otel-data namespace: cursor-otelspec: accessModes: [ReadWriteOnce] resources: requests: storage: 20Gi# One-off reader pod: the collector image has no shell, so the files are read from# this pod, which mounts the same volume read-only.# kubectl apply -f reader.yaml# kubectl -n cursor-otel exec cursor-otel-reader -- cat /data/cursor-logs.jsonl | jq ...# kubectl delete -f reader.yaml# ReadWriteOnce volume: on a cluster with several nodes, this pod must run on the node# of the collector (uncomment nodeName and set that node).apiVersion: v1kind: Podmetadata: name: cursor-otel-reader namespace: cursor-otelspec: terminationGracePeriodSeconds: 1 # stops at once (it only sleeps) # nodeName: <node of the collector pod> securityContext: runAsUser: 10001 runAsGroup: 10001 runAsNonRoot: true containers: - name: reader image: busybox:1.38.0-musl@sha256:80e38f9a1b39188b8bdb28879178edb322a4402b081a9aedda1924609decd6f6 command: ["sleep", "3600"] securityContext: readOnlyRootFilesystem: true allowPrivilegeEscalation: false capabilities: drop: [ALL] volumeMounts: - name: data mountPath: /data readOnly: true volumes: - name: data persistentVolumeClaim: claimName: cursor-otel-data readOnly: true#!/usr/bin/env bash# Creates or updates the two collector Secrets from files: the token never appears on# a command line (neither in the shell history nor in "ps").## First run: creates cursor-otel.env (mode 600) with a new token, then stops.# Read the token there to enter it in Cursor, and fill in BLOCKED_EMAILS if needed.# Second run: creates the cursor-otel Secret (from cursor-otel.env) and cursor-otel-tls# (from fullchain.pem and privkey.pem, the certificate of your domain name).# After any change to cursor-otel.env: run this script again, then# kubectl -n cursor-otel rollout restart deployment cursor-otel-opentelemetry-collectorset -euo pipefailumask 077NS=cursor-otel
if [ ! -f cursor-otel.env ]; then # printf is a shell builtin: the token goes through no visible process. printf '%s\n' \ "# Token expected in \"Authorization: Bearer <token>\", the same as in Cursor." \ "CURSOR_OTLP_TOKEN=$(openssl rand -hex 32)" \ "# Rotation: add CURSOR_OTLP_TOKEN_NEXT=<new token> here for the time of the switch." \ "# Block list: addresses separated by commas, semicolons or spaces." \ "# No double quotes (the collector would not start)." \ "BLOCKED_EMAILS=" \ "# Retention of the renamed files, in days (0: never deleted)." \ "RETENTION_DAYS=90" >cursor-otel.env echo "cursor-otel.env created (600). Fill in BLOCKED_EMAILS if needed, then run this script again." exit 0fi
# A double quote in BLOCKED_EMAILS stops the collector from starting: refuse it here,# before touching the cluster (with Recreate, the old pod would already be stopped).if grep '^BLOCKED_EMAILS=' cursor-otel.env | grep -q '"'; then echo "Error: BLOCKED_EMAILS contains a double quote. Remove it from cursor-otel.env." >&2 exit 1fi
kubectl get namespace "$NS" >/dev/null 2>&1 || kubectl create namespace "$NS"# --dry-run=client -o yaml | kubectl apply --server-side: creates the Secret, or updates it.# --server-side: no copy of the Secret (token, TLS key) in the last-applied-configuration# annotation, and a key removed from the file disappears from the Secret.kubectl -n "$NS" create secret generic cursor-otel --from-env-file=cursor-otel.env \ --dry-run=client -o yaml | kubectl apply --server-side -f -kubectl -n "$NS" create secret tls cursor-otel-tls --cert=fullchain.pem --key=privkey.pem \ --dry-run=client -o yaml | kubectl apply --server-side -f -# Secrets created earlier by a "kubectl apply" without --server-side: --server-side still# updates their last-applied-configuration annotation (a copy of the Secret). Remove it.kubectl -n "$NS" annotate secret cursor-otel cursor-otel-tls \ kubectl.kubernetes.io/last-applied-configuration- >/dev/null- One replica,
Recreate. The files are written to aReadWriteOncevolume: two pods would write to the same files. On an upgrade, the old pod stops before the new one opens them. - The chart adds its own defaults. It merges
configwith a configuration that opens Jaeger, Zipkin, gRPC, traces and abatchprocessor: thenullvalues invalues.yamlremove them. - Behind a cloud load balancer. With
externalTrafficPolicy: Cluster, the default, the ingress controller sees a node’s address instead of Cursor’s, and the allowlist answers403. SetexternalTrafficPolicy: Localon the controller’s Service, or enable the PROXY protocol. This case was not part of our tests. - ingress-nginx is retired. The project stopped in March 2026. Keep it if you already run it; otherwise expose the collector through your Gateway API implementation, with the same three rules: the certificate, Cursor’s addresses, 64 MiB.
- Reading the files. The collector image has no shell:
reader.yamlstarts a short-lived pod that mounts the same volume read-only.
Send to the tools you already use
Section titled “Send to the tools you already use”The collector forwards what it receives to your tool and keeps writing the files on disk, as a local copy. Each tool takes one extra file, collector.<tool>.yaml, read by the collector after config.yaml, and on a VM one Compose overlay that passes the address and the credentials from .env. Each was tested end to end: the data was read back in the tool (for Datadog, in a local stand-in for its intake), then the tool was cut off and restored, with a restart of the collector in between, without loss. One exception, for Datadog, is explained in its tab.
- A stop of the tool delays the data, it does not lose it. Each forwarding keeps its queue on disk (
file_storage), up to 5 GiB per exporter, and retries without time limit; the queue survives a restart of the collector. In our tests, 1,000 requests with 32 KiB prompts took 35 to 40 MB of queue. Once the queue is full, the collector answers503: Cursor replays the logs, and the metrics of that moment are kept only in the files on disk. - Duplicates. Cursor can deliver a log twice, with the same
cursor.event.id. Remove duplicates on that field when reading, or at write time where the tool allows it (Elasticsearch, below). - On Kubernetes, the same blocks go under
config:invalues.yaml. Two examples,values.grafana.yamlandvalues.datadog.yaml, both deployed and tested on Kubernetes, are in the Grafana and Datadog tabs: pass them to Helm aftervalues.yaml.
Logs to Loki and metrics to Prometheus or Mimir, both through their native OTLP endpoint. Tested with Loki and Prometheus.
# Grafana: logs to Loki, metrics to Prometheus or Mimir, both over native OTLP.# Added to config.yaml, which stays unchanged: the collector reads both files,# and the lists below replace those of config.yaml. The JSON Lines file is kept.
extensions: # Queue on disk, in data/queue: if Loki or Prometheus stop answering, or if # the collector restarts, pending sends are kept and resumed. file_storage/queue: directory: /data/queue create_directory: true compaction: directory: /data/queue on_start: true
processors: # Loki does not keep the OTLP event name: without this copy into an attribute (which Loki # stores as event_name metadata), prompts and responses can no longer be told apart. transform/loki: log_statements: - set(log.attributes["event.name"], log.event_name) where log.event_name != ""
# Prometheus only turns service.name and service.instance.id into labels: the series of # two people would merge. The resource attributes (email, surface, # team...) are copied onto each data point. transform/prometheus: metric_statements: - merge_maps(datapoint.attributes, resource.attributes, "insert")
# Cursor sends delta sums; Prometheus and Mimir store cumulative totals. # This processor adds up the deltas of each series. It keeps state in memory: # after a restart, totals start again from zero (seen as a counter reset). delta_to_cumulative: max_stale: 1h
exporters: # Loki: native OTLP endpoint, <url>/v1/logs. Example: http://loki:3100/otlp otlp_http/loki: endpoint: ${env:LOKI_OTLP_URL} sending_queue: storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0 # retries with no time limit # Prometheus (started with --web.enable-otlp-receiver): http://prometheus:9090/api/v1/otlp # Mimir: http://mimir:9009/otlp otlp_http/prometheus: endpoint: ${env:PROMETHEUS_OTLP_URL} sending_queue: storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0
service: extensions: [bearertokenauth, health_check, file_storage/queue] pipelines: logs: processors: [memory_limiter, filter/blocklist, transform/loki] exporters: [file/logs, otlp_http/loki] metrics: processors: [memory_limiter, filter/blocklist, transform/prometheus, delta_to_cumulative] exporters: [file/metrics, otlp_http/prometheus]# Adds sending to Grafana (Loki, Prometheus or Mimir) to the Docker Compose collector.# Add it to COMPOSE_FILE in .env (see .env.example), then: docker compose up -d# In .env:# LOKI_OTLP_URL=http://loki.internal:3100/otlp# PROMETHEUS_OTLP_URL=http://prometheus.internal:9090/api/v1/otlp
services: collector: command: ["--config=/etc/otelcol/config.yaml", "--config=/etc/otelcol/grafana.yaml"] environment: LOKI_OTLP_URL: ${LOKI_OTLP_URL:?set LOKI_OTLP_URL in .env} PROMETHEUS_OTLP_URL: ${PROMETHEUS_OTLP_URL:?set PROMETHEUS_OTLP_URL in .env} volumes: - ./collector.grafana.yaml:/etc/otelcol/grafana.yaml:ro- Loki does not keep the OTLP event name: the
transform/lokiprocessor copies it, otherwise requests and responses look the same. - Prometheus and Mimir store totals, Cursor sends increments:
delta_to_cumulativeadds them up. Prometheus must be started with--web.enable-otlp-receiver. - In Grafana Explore:
{service_name="cursor"} | event_name="cursor.conversation.user_message".
On Kubernetes:
helm upgrade --install cursor-otel opentelemetry-collector \ --repo https://open-telemetry.github.io/opentelemetry-helm-charts --version 0.183.2 \ --namespace cursor-otel -f values.yaml -f values.grafana.yaml# Adds sending to Grafana (Loki, Prometheus or Mimir) to the collector of the Helm chart.# Same blocks as collector.grafana.yaml (Docker Compose setup); Helm merges them with# values.yaml, and the lists below replace those of values.yaml.# helm upgrade --install cursor-otel opentelemetry-collector \# --repo https://open-telemetry.github.io/opentelemetry-helm-charts --version 0.183.2 \# --namespace cursor-otel -f values.yaml -f values.grafana.yaml
extraEnvs: - name: LOKI_OTLP_URL value: http://loki.monitoring:3100/otlp # your Loki - name: PROMETHEUS_OTLP_URL value: http://prometheus.monitoring:9090/api/v1/otlp # your Prometheus, or Mimir: .../otlp
config: extensions: # Queue on disk, on the persistent volume (/data/queue). file_storage/queue: directory: /data/queue create_directory: true compaction: directory: /data/queue on_start: true
processors: # Loki does not keep the OTLP event name: it is copied into an attribute. transform/loki: log_statements: - set(log.attributes["event.name"], log.event_name) where log.event_name != "" # Prometheus: resource attributes (email, surface...) copied as labels. transform/prometheus: metric_statements: - merge_maps(datapoint.attributes, resource.attributes, "insert") # Cursor deltas turned into cumulative totals. delta_to_cumulative: max_stale: 1h
exporters: otlp_http/loki: endpoint: ${env:LOKI_OTLP_URL} sending_queue: storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0 # retries with no time limit otlp_http/prometheus: endpoint: ${env:PROMETHEUS_OTLP_URL} sending_queue: storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0
service: extensions: [bearertokenauth, health_check, file_storage/queue] pipelines: logs: processors: [memory_limiter, filter/blocklist, transform/loki] exporters: [file/logs, otlp_http/loki] metrics: processors: [memory_limiter, filter/blocklist, transform/prometheus, delta_to_cumulative] exporters: [file/metrics, otlp_http/prometheus]
Grafana Explore on Loki: Cursor requests and responses, with the person’s address, the surface (desktop or cli) and the event name, sent by the collector over OTLP. Test data.
Two ways. The collector sends straight to Datadog with its datadog exporter, or it forwards to a Datadog Agent you already run. Tested against a local stand-in for Datadog’s intake: the format that leaves the collector is checked, not the display in Datadog.
# Datadog, path 1: the datadog exporter of the collector sends straight to the Datadog API.# Added to config.yaml, which stays unchanged: the collector reads both files,# and the lists below replace those of config.yaml. The JSON Lines file is kept.
extensions: # Queue on disk, in data/queue: if Datadog stops answering, or if the collector restarts, # pending metrics are kept and resumed (with the feature gate of docker-compose.datadog.yml). # Logs are acknowledged by the exporter before they are sent: a restart during a Datadog # outage loses them for Datadog (the file keeps them). file_storage/queue: directory: /data/queue create_directory: true compaction: directory: /data/queue on_start: true
exporters: datadog: api: key: ${env:DD_API_KEY} site: ${env:DD_SITE} # datadoghq.eu, datadoghq.com, us5.datadoghq.com... # Fixed host name: avoids automatic detection (slow at startup, no use here). hostname: cursor-otel-collector metrics: # Resource attributes (email, surface, team...) become metric tags. # Useful per person; each combination counts as a custom metric. resource_attributes_as_tags: true sending_queue: storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0 # retries with no time limit
service: extensions: [bearertokenauth, health_check, file_storage/queue] pipelines: logs: exporters: [file/logs, datadog] metrics: exporters: [file/metrics, datadog]# Adds sending to Datadog (datadog exporter) to the Docker Compose collector.# Add it to COMPOSE_FILE in .env (see .env.example), then: docker compose up -d# In .env:# DD_API_KEY=...# DD_SITE=datadoghq.eu
services: collector: # This (alpha) feature gate passes metric delivery failures back to the disk queue. # Without it, the exporter keeps its retries in memory: lost if the collector restarts # during a Datadog outage. No equivalent for logs in 0.166.0. command: ["--config=/etc/otelcol/config.yaml", "--config=/etc/otelcol/datadog.yaml", "--feature-gates=datadog.serializerexporter.UseSyncForwarder"] environment: DD_API_KEY: ${DD_API_KEY:?set DD_API_KEY in .env} DD_SITE: ${DD_SITE:?set DD_SITE in .env} volumes: - ./collector.datadog.yaml:/etc/otelcol/datadog.yaml:roWith a Datadog Agent:
# Datadog, path 2: the collector forwards over OTLP to a Datadog Agent, which sends to Datadog.# Added to config.yaml, which stays unchanged: the collector reads both files,# and the lists below replace those of config.yaml. The JSON Lines file is kept.
extensions: # Queue on disk, in data/queue: if the tool stops answering, or if the # collector restarts, pending sends are kept and resumed. file_storage/queue: directory: /data/queue create_directory: true compaction: directory: /data/queue on_start: true
exporters: otlp_http/datadog-agent: endpoint: ${env:DD_AGENT_OTLP_URL} # http://datadog-agent:4318 sending_queue: storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0 # retries with no time limit
service: extensions: [bearertokenauth, health_check, file_storage/queue] pipelines: logs: exporters: [file/logs, otlp_http/datadog-agent] metrics: exporters: [file/metrics, otlp_http/datadog-agent]# Adds a Datadog Agent, with OTLP ingestion, behind the Docker Compose collector.# Add it to COMPOSE_FILE in .env (see .env.example), then: docker compose up -d# In .env:# DD_API_KEY=...# DD_SITE=datadoghq.eu# Only the collector can reach the Agent (no published port): its OTLP receiver# has no authentication.
services: datadog-agent: image: datadog/agent:7.86.0@sha256:4bd7056e94b38648710768afd3bedf76f1d5f473c3dc47ecebe32bf02558c410 environment: DD_API_KEY: ${DD_API_KEY:?set DD_API_KEY in .env} DD_SITE: ${DD_SITE:?set DD_SITE in .env} DD_HOSTNAME: cursor-otel-agent DD_LOGS_ENABLED: "true" DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_HTTP_ENDPOINT: 0.0.0.0:4318 DD_OTLP_CONFIG_LOGS_ENABLED: "true" # Email, surface, team... as metric tags (like resource_attributes_as_tags in path 1) DD_OTLP_CONFIG_METRICS_RESOURCE_ATTRIBUTES_AS_TAGS: "true" restart: unless-stopped
collector: command: ["--config=/etc/otelcol/config.yaml", "--config=/etc/otelcol/datadog-agent.yaml"] environment: DD_AGENT_OTLP_URL: http://datadog-agent:4318 volumes: - ./collector.datadog-agent.yaml:/etc/otelcol/datadog-agent.yaml:ro depends_on: datadog-agent: condition: service_startedresource_attributes_as_tagsturns the person’s address, the surface and the team into tags of the metrics: useful per person, and each combination counts as a custom metric in Datadog.- In version 0.166.0, a restart of the collector during a Datadog outage keeps the queued metrics, thanks to the feature gate set in
docker-compose.datadog.yml(orvalues.datadog.yaml). It does not keep the logs queued for Datadog: those stay only in the files on disk. With the Agent, a restart of the Agent itself during a Datadog outage loses what it held. - Cursor’s documentation shows the Agent receiving the export directly. The Agent’s OTLP receiver has no authentication: in our test it accepted requests without a token. Keep a collector, or a proxy that checks the token, in front of it.
On Kubernetes, create the datadog secret from a datadog.env file (mode 600) holding the line DD_API_KEY=<your key>, then install:
kubectl -n cursor-otel create secret generic datadog --from-env-file=datadog.envhelm upgrade --install cursor-otel opentelemetry-collector \ --repo https://open-telemetry.github.io/opentelemetry-helm-charts --version 0.183.2 \ --namespace cursor-otel -f values.yaml -f values.datadog.yaml# Adds sending to Datadog (datadog exporter) to the collector of the Helm chart.# Same blocks as collector.datadog.yaml (Docker Compose setup); Helm merges them with# values.yaml, and the lists below replace those of values.yaml.# API key: a "datadog" Secret, created from a datadog.env file (mode 600) that holds the# line DD_API_KEY=<your key>, then the chart:# kubectl -n cursor-otel create secret generic datadog --from-env-file=datadog.env# helm upgrade --install cursor-otel opentelemetry-collector \# --repo https://open-telemetry.github.io/opentelemetry-helm-charts --version 0.183.2 \# --namespace cursor-otel -f values.yaml -f values.datadog.yaml
# This (alpha) feature gate passes metric delivery failures back to the disk queue.# Without it, the exporter keeps its retries in memory: lost if the pod restarts during a# Datadog outage. No equivalent for logs in 0.166.0.command: extraArgs: - --feature-gates=datadog.serializerexporter.UseSyncForwarder
extraEnvs: - name: DD_API_KEY valueFrom: secretKeyRef: name: datadog key: DD_API_KEY - name: DD_SITE value: datadoghq.eu # your Datadog site
config: extensions: # Queue on disk, on the persistent volume (/data/queue). As with Compose, it keeps the # metrics; logs are acknowledged by the exporter before they are sent. file_storage/queue: directory: /data/queue create_directory: true compaction: directory: /data/queue on_start: true
exporters: datadog: api: key: ${env:DD_API_KEY} site: ${env:DD_SITE} hostname: cursor-otel-collector metrics: resource_attributes_as_tags: true sending_queue: storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0 # retries with no time limit
service: extensions: [bearertokenauth, health_check, file_storage/queue] pipelines: logs: exporters: [file/logs, datadog] metrics: exporters: [file/metrics, datadog]Logs and metrics in Elasticsearch, read in Kibana. Tested with Elasticsearch and Kibana 9.5.
# Elastic: logs and metrics in Elasticsearch, searchable in Kibana (Discover).# Added to config.yaml, which stays unchanged: the collector reads both files,# and the lists below replace those of config.yaml. The JSON Lines file is kept.# Data goes to the logs-generic.otel-default and metrics-generic.otel-default data streams.
extensions: # Queue on disk, in data/queue: if the tool stops answering, or if the # collector restarts, pending sends are kept and resumed. file_storage/queue: directory: /data/queue create_directory: true compaction: directory: /data/queue on_start: true
processors: # Cursor can deliver a log twice, with the same cursor.event.id. Used as the # document id, it makes Elasticsearch refuse the duplicate: a single copy is kept. transform/elastic-id: log_statements: - set(log.attributes["elasticsearch.document_id"], log.attributes["cursor.event.id"]) where log.attributes["cursor.event.id"] != nil
exporters: elasticsearch: endpoint: ${env:ELASTICSEARCH_URL} # https://elasticsearch.internal:9200 api_key: ${env:ELASTICSEARCH_API_KEY} # encoded key ("encoded" field at creation) logs_dynamic_id: enabled: true sending_queue: storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) # This exporter has its own retries (2 by default): they are extended, at most one # attempt per minute, to cover an Elasticsearch outage of several days. retry: max_retries: 10000 max_interval: 1m
service: extensions: [bearertokenauth, health_check, file_storage/queue] pipelines: logs: processors: [memory_limiter, filter/blocklist, transform/elastic-id] exporters: [file/logs, elasticsearch] metrics: exporters: [file/metrics, elasticsearch]# Adds sending to Elasticsearch to the Docker Compose collector.# Add it to COMPOSE_FILE in .env (see .env.example), then: docker compose up -d# In .env:# ELASTICSEARCH_URL=https://elasticsearch.internal:9200# ELASTICSEARCH_API_KEY=... (see elastic-api-key.http)
services: collector: command: ["--config=/etc/otelcol/config.yaml", "--config=/etc/otelcol/elastic.yaml"] environment: ELASTICSEARCH_URL: ${ELASTICSEARCH_URL:?set ELASTICSEARCH_URL in .env} ELASTICSEARCH_API_KEY: ${ELASTICSEARCH_API_KEY:?set ELASTICSEARCH_API_KEY in .env} volumes: - ./collector.elastic.yaml:/etc/otelcol/elastic.yaml:roThe collector’s API key, limited to writing in logs-* and metrics-*, created in Kibana’s Dev Tools:
# API key of the collector: write to the logs-* and metrics-* data streams, nothing else.# Run it in Kibana (Dev Tools) with an administrator account. Keep the "encoded" field# of the response: it is ELASTICSEARCH_API_KEY.POST /_security/api_key{ "name": "cursor-otel-collector", "role_descriptors": { "cursor_otel_writer": { "cluster": ["monitor"], "indices": [ { "names": ["logs-*", "metrics-*"], "privileges": ["auto_configure", "create_doc"] } ] } }}cursor.event.idbecomes the document id: Elasticsearch refuses the duplicate, and keeps one copy.- In Kibana, a data view on
logs-generic.otel-defaultshows the requests in Discover.

Kibana Discover: one row per request or response, with the address, the surface, the event name and the text. Test data.
Logs and metrics through the HTTP Event Collector. Tested with Splunk Enterprise 10.4.
# Splunk: logs and metrics through the HTTP Event Collector (HEC).# Added to config.yaml, which stays unchanged: the collector reads both files,# and the lists below replace those of config.yaml. The JSON Lines file is kept.# Needed in Splunk: an events index "cursor", a metrics index "cursor_metrics",# and a HEC token allowed on both.
extensions: # Queue on disk, in data/queue: if the tool stops answering, or if the # collector restarts, pending sends are kept and resumed. file_storage/queue: directory: /data/queue create_directory: true compaction: directory: /data/queue on_start: true
exporters: splunk_hec/logs: endpoint: ${env:SPLUNK_HEC_URL} # https://splunk.internal:8088/services/collector token: ${env:SPLUNK_HEC_TOKEN} index: cursor source: cursor sourcetype: cursor:otel sending_queue: storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0 # retries with no time limit splunk_hec/metrics: endpoint: ${env:SPLUNK_HEC_URL} token: ${env:SPLUNK_HEC_TOKEN} index: cursor_metrics source: cursor sourcetype: cursor:otel:metrics sending_queue: storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0
service: extensions: [bearertokenauth, health_check, file_storage/queue] pipelines: logs: exporters: [file/logs, splunk_hec/logs] metrics: exporters: [file/metrics, splunk_hec/metrics]# Adds sending to Splunk (HEC) to the Docker Compose collector.# Add it to COMPOSE_FILE in .env (see .env.example), then: docker compose up -d# In .env:# SPLUNK_HEC_URL=https://splunk.internal:8088/services/collector# SPLUNK_HEC_TOKEN=...
services: collector: command: ["--config=/etc/otelcol/config.yaml", "--config=/etc/otelcol/splunk.yaml"] environment: SPLUNK_HEC_URL: ${SPLUNK_HEC_URL:?set SPLUNK_HEC_URL in .env} SPLUNK_HEC_TOKEN: ${SPLUNK_HEC_TOKEN:?set SPLUNK_HEC_TOKEN in .env} volumes: - ./collector.splunk.yaml:/etc/otelcol/splunk.yaml:roTo prepare Splunk, the event index cursor, the metrics index cursor_metrics and an HEC token limited to both, through the management API:
#!/usr/bin/env bash# Prepares Splunk for the collector, through the management REST API (port 8089): enables HEC,# creates the events index "cursor", the metrics index "cursor_metrics", and a HEC token# limited to these two indexes. Prints the token: it is SPLUNK_HEC_TOKEN.# Usage: SPLUNK_MGMT=https://splunk.internal:8089 SPLUNK_ADMIN=admin bash prepare-splunk.sh# (the password is asked). -k: port 8089 often has a self-signed certificate;# replace it with --cacert <your CA> if you have one.set -euo pipefail: "${SPLUNK_MGMT:?SPLUNK_MGMT, for example https://splunk.internal:8089}": "${SPLUNK_ADMIN:=admin}"read -r -s -p "Password for $SPLUNK_ADMIN: " PW; echo# The credentials go to curl through its standard input (-K -): they do not show in "ps".# In this format, "\" and the double quote must be preceded by a "\".CRED=${PW//\\/\\\\}; CRED=${CRED//\"/\\\"}api() { printf 'user = "%s:%s"\n' "$SPLUNK_ADMIN" "$CRED" | curl -sS -k -K - "$@" -d output_mode=json; }
api "$SPLUNK_MGMT/servicesNS/nobody/splunk_httpinput/data/inputs/http/http" -d disabled=0 >/dev/nullapi "$SPLUNK_MGMT/services/data/indexes" -d name=cursor >/dev/nullapi "$SPLUNK_MGMT/services/data/indexes" -d name=cursor_metrics -d datatype=metric >/dev/nullapi "$SPLUNK_MGMT/servicesNS/nobody/splunk_httpinput/data/inputs/http" \ -d name=cursor-otel -d index=cursor -d indexes=cursor,cursor_metrics | sed -n 's/.*"token":"\([^"]*\)".*/SPLUNK_HEC_TOKEN=\1/p'- Attributes arrive as indexed fields: name them in the search, for example
index=cursor otel.log.name="cursor.conversation.*" | sort _time | table _time cursor.user.email cursor.surface otel.log.name _raw. The event name is inotel.log.name.

A Splunk search on the cursor index: requests and responses received through the HTTP Event Collector, as a table. Test data.
Logs and metrics in SQL tables, created by the collector on first start. Tested with ClickHouse 26.9.
# ClickHouse: logs and metrics in SQL tables.# Added to config.yaml, which stays unchanged: the collector reads both files,# and the lists below replace those of config.yaml. The JSON Lines file is kept.
extensions: # Queue on disk, in data/queue: if the tool stops answering, or if the # collector restarts, pending sends are kept and resumed. file_storage/queue: directory: /data/queue create_directory: true compaction: directory: /data/queue on_start: true
exporters: clickhouse: # tcp://clickhouse.internal:9000, or https://clickhouse.internal:8443 over HTTPS endpoint: ${env:CLICKHOUSE_ENDPOINT} username: ${env:CLICKHOUSE_USER} password: ${env:CLICKHOUSE_PASSWORD} database: cursor_otel # Creates the database and tables (otel_logs, otel_metrics_sum...) at startup. Needs the # CREATE privilege; set false if you manage the schema. ClickHouse must answer at startup: # otherwise the collector stops, and Docker restarts it. create_schema: true # Retention: ClickHouse deletes rows older than 90 days. ttl: 2160h sending_queue: storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0 # retries with no time limit
service: extensions: [bearertokenauth, health_check, file_storage/queue] pipelines: logs: exporters: [file/logs, clickhouse] metrics: exporters: [file/metrics, clickhouse]# Adds sending to ClickHouse to the Docker Compose collector.# Add it to COMPOSE_FILE in .env (see .env.example), then: docker compose up -d# In .env:# CLICKHOUSE_ENDPOINT=tcp://clickhouse.internal:9000# CLICKHOUSE_USER=cursor_otel# CLICKHOUSE_PASSWORD=...
services: collector: command: ["--config=/etc/otelcol/config.yaml", "--config=/etc/otelcol/clickhouse.yaml"] environment: CLICKHOUSE_ENDPOINT: ${CLICKHOUSE_ENDPOINT:?set CLICKHOUSE_ENDPOINT in .env} CLICKHOUSE_USER: ${CLICKHOUSE_USER:?set CLICKHOUSE_USER in .env} CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:?set CLICKHOUSE_PASSWORD in .env} volumes: - ./collector.clickhouse.yaml:/etc/otelcol/clickhouse.yaml:ro-- The prompts, with email and surface. LIMIT 1 BY removes duplicates:-- Cursor can deliver the same log twice, with the same cursor.event.id.SELECT Timestamp, ResourceAttributes['cursor.user.email'] AS email, ResourceAttributes['cursor.surface'] AS surface, Body AS promptFROM cursor_otel.otel_logsWHERE if(EventName != '', EventName, LogAttributes['event.name']) = 'cursor.conversation.user_message'ORDER BY Timestamp DESCLIMIT 1 BY LogAttributes['cursor.event.id']LIMIT 20;
-- Tokens per person and per type: sum of the deltas.SELECT ResourceAttributes['cursor.user.email'] AS email, Attributes['cursor.token.type'] AS type, sum(Value) AS tokensFROM cursor_otel.otel_metrics_sumWHERE MetricName = 'cursor.token.usage'GROUP BY email, typeORDER BY email, type;LIMIT 1 BYremoves duplicates oncursor.event.id.ttl: 2160hkeeps 90 days. ClickHouse must answer when the collector starts: otherwise the collector stops, and Docker restarts it.

ClickHouse’s SQL console: the otel_logs table, one row per message, duplicates removed with LIMIT 1 BY on cursor.event.id. Test data.
One compressed JSON object per send, in AWS S3 or a compatible store. Tested with MinIO.
# S3 (AWS S3, MinIO or another compatible store): one compressed JSON object per send.# Added to config.yaml, which stays unchanged: the collector reads both files,# and the lists below replace those of config.yaml. The JSON Lines file is kept.# Access keys come from the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY variables# (or from the IAM role of the machine on AWS).
extensions: # Queue on disk, in data/queue: if the tool stops answering, or if the # collector restarts, pending sends are kept and resumed. file_storage/queue: directory: /data/queue create_directory: true compaction: directory: /data/queue on_start: true
exporters: awss3/logs: s3uploader: region: ${env:S3_REGION} s3_bucket: ${env:S3_BUCKET} s3_prefix: cursor/logs # MinIO and compatible stores: their URL, and path-style addressing. # AWS S3: remove these two lines. endpoint: ${env:S3_ENDPOINT} s3_force_path_style: true compression: gzip unique_key_func_name: uuidv7 marshaler: otlp_json sending_queue: # off by default for this exporter enabled: true storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0 # retries with no time limit awss3/metrics: s3uploader: region: ${env:S3_REGION} s3_bucket: ${env:S3_BUCKET} s3_prefix: cursor/metrics endpoint: ${env:S3_ENDPOINT} s3_force_path_style: true compression: gzip unique_key_func_name: uuidv7 marshaler: otlp_json sending_queue: enabled: true storage: file_storage/queue sizer: bytes queue_size: 5368709120 # 5 GiB pending at most; above, 503 (Cursor resends the logs) retry_on_failure: max_elapsed_time: 0
service: extensions: [bearertokenauth, health_check, file_storage/queue] pipelines: logs: exporters: [file/logs, awss3/logs] metrics: exporters: [file/metrics, awss3/metrics]# Adds sending to S3 to the Docker Compose collector.# Add it to COMPOSE_FILE in .env (see .env.example), then: docker compose up -d# In .env:# S3_REGION=eu-west-3# S3_BUCKET=cursor-otel# S3_ENDPOINT=https://minio.internal:9000# AWS_ACCESS_KEY_ID=...# AWS_SECRET_ACCESS_KEY=...
services: collector: command: ["--config=/etc/otelcol/config.yaml", "--config=/etc/otelcol/s3.yaml"] environment: S3_REGION: ${S3_REGION:?set S3_REGION in .env} S3_BUCKET: ${S3_BUCKET:?set S3_BUCKET in .env} S3_ENDPOINT: ${S3_ENDPOINT:-} # With an IAM role (machine on AWS), remove these two lines. AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:?set AWS_ACCESS_KEY_ID in .env} AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:?set AWS_SECRET_ACCESS_KEY in .env} volumes: - ./collector.s3.yaml:/etc/otelcol/s3.yaml:ro- On AWS S3, remove the
endpointands3_force_path_stylelines. With the machine’s IAM role, which is better than keys, also remove the twoAWS_lines fromdocker-compose.s3.yml. - Objects are written under
cursor/logs/andcursor/metrics/, partitioned by date.
Can Cursor send straight to the tool, without a collector? Only to a Datadog Agent, and its OTLP receiver has no authentication. Loki has no metrics endpoint, Prometheus refuses Cursor’s increments, and Elasticsearch, Splunk, ClickHouse and S3 have no native OTLP endpoint in the versions tested. With a single destination in Cursor, the collector is the simplest way.
Configure Cursor
Section titled “Configure Cursor”Once the collector answers on its public address, a team admin creates the destination. The steps follow Cursor’s documentation: Enable and Conversation content.
-
Create the destination
In the Cursor dashboard, Team Settings > OpenTelemetry Export, then Create destination. The base address is
https://otel.example.com, without/v1and without:4318: Cursor adds/v1/logsand/v1/metrics. Add the headerAuthorizationwith the valueBearer <token>, the token from.env(or fromcursor-otel.envon Kubernetes). -
Test, then enable
Test connection checks the address and the token. Then Enable: according to Cursor, data starts within about a minute.
-
Allow conversation content
Still in Team Settings > OpenTelemetry Export, turn on Allow conversation content export for the team. Then, on the destination, turn on Conversation content: Prompts and Responses turn on, Tool I/O stays off unless you turn it on.
-
Choose what else is sent
Each family of data has its own toggle on the destination. New families Cursor adds turn on by themselves unless you turn off
auto_enable_new_families: turn it off if you want to decide on each one.
Check that it works
Section titled “Check that it works”First without Cursor, on the collector’s host, with a request that imitates Cursor’s: the collector must be alive, refuse a request without the token, accept a request with it, and write it.
In the folder of docker-compose.yml, with curl and jq installed: bash verify.sh. It writes one test record, from test.otel@example.com, into your data, and into your tools if the collector forwards to them.
#!/usr/bin/env bash# Check the collector without Cursor. Run it on the VM, in the folder of docker-compose.yml.# Needs: curl and jq.# One test record (test.otel@example.com) is written to the data, and forwarded to the# tools connected to the collector, if any.
# The token, read from .envTOKEN=$(grep '^CURSOR_OTLP_TOKEN=' .env | cut -d= -f2-)
# 1. The collector is running: 200 and "Server available"curl -sS -w '\n' http://127.0.0.1:13133/
# 2. Without a token, the request is refused: 401curl -sS -o /dev/null -w '%{http_code}\n' -X POST http://127.0.0.1:4318/v1/logs \ -H 'Content-Type: application/x-protobuf' --data-binary ''
# 3. A fake Cursor prompt, as OTLP JSON, with the token: 200 and {"partialSuccess":{}}# The token goes through the standard input of curl (-K -): it does not show in "ps".NOW=$(date +%s)000000000cat >cursor-test.json <<EOF{"resourceLogs":[{"resource":{"attributes":[ {"key":"service.name","value":{"stringValue":"cursor"}}, {"key":"cursor.team.id","value":{"intValue":"1"}}, {"key":"cursor.surface","value":{"stringValue":"cli"}}, {"key":"cursor.entrypoint","value":{"stringValue":"cli"}}, {"key":"cursor.user.id","value":{"intValue":"1"}}, {"key":"cursor.user.account_id","value":{"stringValue":"user_test"}}, {"key":"cursor.user.email","value":{"stringValue":"test.otel@example.com"}}]}, "scopeLogs":[{"scope":{"name":"cursor.telemetry","version":"0.1.0"}, "logRecords":[{"timeUnixNano":"$NOW","severityNumber":9, "eventName":"cursor.conversation.user_message", "body":{"stringValue":"Collector test: this prompt should appear in the output."}, "attributes":[ {"key":"cursor.event.id","value":{"stringValue":"customer-telemetry:v1:test-$NOW"}}, {"key":"cursor.conversation.id","value":{"stringValue":"test-conversation"}}, {"key":"cursor.conversation.provenance","value":{"stringValue":"server"}}, {"key":"cursor.conversation.message.id","value":{"stringValue":"test-message"}}, {"key":"cursor.conversation.content_truncated","value":{"boolValue":false}}]}]}]}]}EOFprintf 'header = "Authorization: Bearer %s"\n' "$TOKEN" | curl -sS -K - -w '\n%{http_code}\n' http://127.0.0.1:4318/v1/logs \ -H 'Content-Type: application/json' --data-binary @cursor-test.jsonrm cursor-test.json
# 4. Read the last 5 prompts written: email, surface, text. The 200 comes after the write.# data/ belongs to the collector user (10001): read it with sudo.sudo jq -r '.resourceLogs[] | (.resource.attributes | map({(.key): .value.stringValue}) | add) as $r | .scopeLogs[].logRecords[] | select((.eventName // (.attributes[] | select(.key == "event.name") | .value.stringValue)) == "cursor.conversation.user_message") | [$r["cursor.user.email"], $r["cursor.surface"], .body.stringValue] | @tsv' data/cursor-logs.jsonl | tail -n 5Expected output, line by line: the health status, 401, the collector’s acknowledgement and 200, then the address, the surface and the text of the test request.
{"status":"Server available","upSince":"2026-11-26T21:19:45.435442802Z","uptime":"6.11524917s"}401{"partialSuccess":{}}200test.otel@example.com cli Collector test: this prompt should appear in the output.From a workstation with kubectl access to the cluster, with curl and jq installed: bash verify-k8s.sh.
#!/usr/bin/env bash# Check the collector on Kubernetes, without Cursor, from an administrator's machine.# The Ingress only accepts Cursor IPs: from your machine it returns 403, which is expected.# So this script goes through "kubectl port-forward", straight to the collector.# Needs: kubectl, curl, jq, and reader.yaml in this folder.# One test record (test.otel@example.com) is written to the data.set -euo pipefailNS=cursor-otelDEPLOY=deployment/cursor-otel-opentelemetry-collectorOTLP_PORT=${OTLP_PORT:-4318} # local ports, change them if they are taken on your machineHEALTH_PORT=${HEALTH_PORT:-13133}
kubectl -n "$NS" port-forward "$DEPLOY" "$OTLP_PORT:4318" "$HEALTH_PORT:13133" >/dev/null &PF=$!trap 'kill $PF 2>/dev/null; wait $PF 2>/dev/null; rm -f cursor-test.json' EXITfor _ in $(seq 1 20); do curl -s -o /dev/null "http://127.0.0.1:$HEALTH_PORT/" && break; sleep 1; done
# 1. The collector is running: 200 and "Server available"curl -sS -w '\n' "http://127.0.0.1:$HEALTH_PORT/"
# 2. Without a token, the request is refused: 401curl -sS -o /dev/null -w '%{http_code}\n' -X POST "http://127.0.0.1:$OTLP_PORT/v1/logs" \ -H 'Content-Type: application/x-protobuf' --data-binary ''
# 3. A fake Cursor prompt, as OTLP JSON, with the token read from the Secret: 200.# The token goes through the standard input of curl (-K -): not shown, not in "ps".NOW=$(date +%s)000000000cat >cursor-test.json <<EOF{"resourceLogs":[{"resource":{"attributes":[ {"key":"service.name","value":{"stringValue":"cursor"}}, {"key":"cursor.team.id","value":{"intValue":"1"}}, {"key":"cursor.surface","value":{"stringValue":"cli"}}, {"key":"cursor.entrypoint","value":{"stringValue":"cli"}}, {"key":"cursor.user.id","value":{"intValue":"1"}}, {"key":"cursor.user.account_id","value":{"stringValue":"user_test"}}, {"key":"cursor.user.email","value":{"stringValue":"test.otel@example.com"}}]}, "scopeLogs":[{"scope":{"name":"cursor.telemetry","version":"0.1.0"}, "logRecords":[{"timeUnixNano":"$NOW","severityNumber":9, "eventName":"cursor.conversation.user_message", "body":{"stringValue":"Collector test: this prompt should appear in the output."}, "attributes":[ {"key":"cursor.event.id","value":{"stringValue":"customer-telemetry:v1:test-$NOW"}}, {"key":"cursor.conversation.id","value":{"stringValue":"test-conversation"}}, {"key":"cursor.conversation.provenance","value":{"stringValue":"server"}}, {"key":"cursor.conversation.message.id","value":{"stringValue":"test-message"}}, {"key":"cursor.conversation.content_truncated","value":{"boolValue":false}}]}]}]}]}EOFTOKEN=$(kubectl -n "$NS" get secret cursor-otel -o jsonpath='{.data.CURSOR_OTLP_TOKEN}' | base64 -d)printf 'header = "Authorization: Bearer %s"\n' "$TOKEN" | curl -sS -K - -w '\n%{http_code}\n' "http://127.0.0.1:$OTLP_PORT/v1/logs" \ -H 'Content-Type: application/json' --data-binary @cursor-test.jsonunset TOKEN
# 4. Read back the last 5 prompts written (email, surface, text) through the reader pod,# then remove it.kubectl apply -f reader.yaml >/dev/nullkubectl -n "$NS" wait --for=condition=ready pod/cursor-otel-reader --timeout=120s >/dev/nullkubectl -n "$NS" exec cursor-otel-reader -- cat /data/cursor-logs.jsonl | jq -r '.resourceLogs[] | (.resource.attributes | map({(.key): .value.stringValue}) | add) as $r | .scopeLogs[].logRecords[] | select((.eventName // (.attributes[] | select(.key == "event.name") | .value.stringValue)) == "cursor.conversation.user_message") | [$r["cursor.user.email"], $r["cursor.surface"], .body.stringValue] | @tsv' | tail -n 5kubectl delete -f reader.yaml --wait=false >/dev/nullThen with Cursor: once the destination is enabled, send a request to Cursor’s agent, in the editor or the CLI. It appears in data/cursor-logs.jsonl within a minute, as a cursor.conversation.user_message record, followed by cursor.conversation.assistant_message for the response.
Leave people out
Section titled “Leave people out”BLOCKED_EMAILS, in .env (or in the Kubernetes secret), lists the addresses for which nothing is kept: their requests, their responses, their usage and their metrics are dropped by the collector before anything is written or forwarded.
- Separate the addresses with commas, semicolons or spaces. Case does not matter.
- No double quote in the list: the collector would not start. On a VM,
validate, below, catches it; on Kubernetes,secrets.shrefuses it. - While the list is not empty, conversation content without an address is dropped too, since it cannot be checked.
- After a change, apply it with
sudo docker compose up -d. On Kubernetes, runbash secrets.shagain, thenkubectl -n cursor-otel rollout restart deployment cursor-otel-opentelemetry-collector. - The list relies on
cursor.user.email. Cursor does not send it for a team in Privacy Mode (Legacy), nor for a run without an owner, such as a Cloud Agent started with a team API key. - The data still leaves Cursor and reaches your collector, which drops it. Cursor’s documentation also says that a member’s turns in Privacy Mode (Legacy) are never exported.
Run it day to day
Section titled “Run it day to day”-
Retention.
RETENTION_DAYS(90 by default) removes renamed files older than that, at each rotation. Rotation only happens at 100 MB: with little traffic, also schedule the purge below, with your own number of days in place of 90. The current file is never removed.Fenêtre de terminal sudo find data -name 'cursor-*-size.jsonl' -mtime +90 -print -deleteEvery night at 3, in root’s crontab (
sudo crontab -e), with the path of your folder:0 3 * * * cd /home/admin/cursor-otel && find data -name 'cursor-*-size.jsonl' -mtime +90 -delete -
Reading the files.
data/belongs to the collector’s user, mode 700: read it withsudo, as inverify.sh. -
Changing the token without losing data. A
401is not retried by Cursor, so the old and the new token must both be accepted for a while. The four steps, tested with continuous traffic and without a single401, are also in.env.example:- Generate a new token with
openssl rand -hex 32, write it inCURSOR_OTLP_TOKEN_NEXT, then runsudo docker compose up -d: both tokens are accepted. - In Cursor, edit the destination and save the new token. Do not delete and recreate it: according to Cursor, that drops the data in flight. The change takes effect in about 30 seconds.
- Wait a few minutes.
- Copy the new token into
CURSOR_OTLP_TOKEN, emptyCURSOR_OTLP_TOKEN_NEXT, then runsudo docker compose up -dagain.
On Kubernetes, the same steps happen in
cursor-otel.env, applied withbash secrets.sh, thenkubectl -n cursor-otel rollout restart deployment cursor-otel-opentelemetry-collector. - Generate a new token with
-
Updating the collector. The image is pinned by its digest. To move to a new version, change the tag and the digest in
docker-compose.yml, validate the configuration, then restart. If the collector forwards to a tool, add its file to the validation, for example--config=/etc/otelcol/grafana.yaml:Fenêtre de terminal sudo docker compose run --rm --no-deps collector validate --config=/etc/otelcol/config.yamlsudo docker compose up -dSome components used here are still in alpha (the
filterprocessor, thefileexporter): their settings can change between versions, which is one more reason to validate before each upgrade. On Kubernetes, changeimage.tagandimage.digestinvalues.yaml, then run thehelm upgrade --installcommand of the tools section, with your own-ffiles. -
Watching it. The Docker health check, or the pod’s readiness, says whether the collector is alive. Watch the disk of
data/, the size ofdata/queue/if the collector forwards to a tool, and, in Cursor, the destination’s status.
What Cursor sends, and what it does not
Section titled “What Cursor sends, and what it does not”| Family | Default | What it carries |
|---|---|---|
model_usage |
On | Tokens, estimated cost, API requests, errors |
tool_calls |
On | Tool calls, as metrics |
skills_hooks_plugins |
On | Skills, hooks and plugins used |
cloud_agents |
On | Cloud Agent lifecycle events |
grok_bot_agent_actions |
On, if Action Recording is on | Grok Bot actions |
conversation_content |
Off | Text of requests (cursor.conversation.user_message), responses (cursor.conversation.assistant_message), and on request tool inputs and outputs (cursor.conversation.tool_io) |
Source: Cursor’s Wire Reference, which lists every event and attribute.
- Who and where. Each record carries the team, the surface (
desktopfor the editor,cli,sdk,cloud_agent,bugbot,grok_bot, orunspecified) and, when known, the person:cursor.user.email,cursor.user.account_id. - Cleaned and capped by Cursor. Cursor removes the secrets it recognizes from the text before sending, and caps each message at 32 KiB, tool inputs and outputs at 8 KiB.
- At least once. A log can arrive twice, with the same
cursor.event.id. Metrics are increments, at most once. - Not sent. Turns from before the export was turned on, subagents a local agent starts, Tab and inline edit, and turns from a member in Privacy Mode (Legacy). Delivery is best effort: a turn can be missing.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
| Test connection fails in Cursor | The certificate, the allowlist or the token. | Read the proxy’s log: the method, the path and the status Cursor received. |
After docker compose up -d, nothing reaches the tool any more |
Compose started without the overlay files. | Declare them in COMPOSE_FILE, in .env. |
503 “sending queue is full” in the logs |
The tool has been unreachable for a long time. | Restore the tool: the queue empties, and Cursor replays the refused logs. |
docker compose up refuses to start: “set CURSOR_OTLP_TOKEN” |
The token is empty in .env. |
Write it (step 2 above). |
401 on every request |
Wrong or missing token, or another scheme than Bearer. |
The header in Cursor is Authorization with Bearer <token>, the token from .env. |
403 through the public address |
The address is not on Cursor’s list, or a load balancer hides it. | Normal from your network. Behind a load balancer, give the proxy the real address. |
413 through the proxy |
nginx’s default limit is 1 MB. | client_max_body_size 64m, or proxy-body-size: "64m" on ingress-nginx. |
400 “request body too large” |
The request is over 64 MiB after decompression. | Raise max_request_body_size, and the proxy’s limit with it. |
503 and “no space left” in the logs |
The disk of data/ is full. |
Free space: Cursor replays the logs. |
permission denied on /data |
The folder belongs to root. |
The prepare task fixes it on start: sudo docker compose up -d. |
| The collector does not start: “condition failed to parse” | A double quote in BLOCKED_EMAILS. |
Remove it. |
| An excluded address still appears | Case, spaces or separators. | The list accepts all three; check the spelling of the address. |
source .env prints “command not found” |
.env is read by Compose, not by the shell. |
Read a value with grep '^NAME=' .env | cut -d= -f2-. |
Files older than RETENTION_DAYS stay |
Removal happens only at a rotation. | Schedule the purge find command. |
| The same request twice in the files | Cursor delivers logs at least once. | Remove duplicates on cursor.event.id when reading. |
413 from Caddy at exactly 64 MiB |
64MB means 64,000,000 bytes. |
Write 64MiB. |
| In Loki, requests and responses look the same | Loki does not keep the event name. | The transform/loki processor. |
Prometheus answers 500 “invalid temporality” |
Cursor sends increments. | The delta_to_cumulative processor. |
Questions
Section titled “Questions”Does any data go to Idun through this setup?
Section titled “Does any data go to Idun through this setup?”No. Cursor sends to your collector, which writes to your disk or your tools. How Idun Cockpit reads these data is agreed at the start of the audit: read access to the storage, or the Cockpit installed in your infrastructure.
Does it slow developers down?
Section titled “Does it slow developers down?”No. The export runs on Cursor’s servers, after the fact. Nothing runs on workstations.
Can we get the history from before the export?
Section titled “Can we get the history from before the export?”Not through the export: it starts when the destination is enabled. Past usage and cost per person, per model and per conversation come from Cursor’s Admin API, without the text of conversations.
Why not the batch processor, as in Cursor’s example?
Section titled “Why not the batch processor, as in Cursor’s example?”Because it answers Cursor before writing. In our tests, with a full disk, Cursor received 200 and the data was lost. Without it, 200 means “written”, and an error goes back to Cursor, which retries the logs.
To see what the tool shows on your own tools, book a call.