Cursor integration with Coralogix
Connect Cursor agent sessions to Coralogix and stream traces from local installations. Once connected, each Cursor agent session appears as a trace in Coralogix with spans for prompts, tool usage, file edits, and session activity.
What you need
- A Coralogix account with a Send-Your-Data API key. In Coralogix, navigate to Settings, then API Keys.
- Your Coralogix OTLP endpoint:
ingress.:443. Use the domain selector at the top of this page to select your region. - Cursor installed on your machine.
Set up
Install
Clone the Coralogix AI agent instrumentation repository and navigate to the Cursor directory:
git clone https://github.com/coralogix/ai-agent-instrumentation.git
cd ai-agent-instrumentation/cursor
Configure
Copy the example environment file:
Open
.envand set the following values:CX_API_KEY— your Send-Your-Data API keyCX_OTLP_ENDPOINT— your OTLP endpoint (ingress.:443)
Install the Cursor hook:
Restart Cursor.
Cursor agent sessions now stream traces to Coralogix.
View data in Coralogix
Open Distributed Tracing in Coralogix and filter by your application and subsystem names. Each Cursor agent session appears as a single trace with all spans grouped by conversation_id.
Data available
| Signal | Where in Coralogix |
|---|---|
| Sessions and unique users | Tracing (cursor.conversation_id, cursor.user_email) |
| Prompt token usage over time | Tracing (cursor.beforeSubmitPrompt—cursor.prompt_len) |
| Lines added and removed | Tracing (cursor.afterFileEdit—cursor.lines_added, cursor.lines_deleted) |
| Session duration | Tracing (cursor.stop—cursor.session_duration_ms) |
| Model distribution | Tracing (gen_ai.request.model) |
| Top tools used | Tracing (gen_ai.tool.name) |
Privacy options
Add these values to your .env before running the installation script:
# Replace all prompt and response text with [MASKED]
CURSOR_MASK_PROMPTS=true
# Skip preToolUse spans to reduce trace noise
CURSOR_OMIT_PRE_TOOL_USE_SPANS=true
Complete configuration
For the full configuration reference, see cursor in the GitHub repository.
Troubleshoot
No traces appear
In Cursor, select View, then Output, then Hooks, and look for export errors. Set CX_OTLP_DEBUG=true in .env, and run ./install.sh --env-file .env again for verbose output.
Hooks do not fire
Confirm that agent hooks are active in Cursor Settings, then Features, then Agent.
Next steps
After you set up the integration, explore the AI Center Overview to monitor performance, costs, quality issues, and security across all your AI applications.