sentry_start_transaction
Initiate performance monitoring transactions to track and analyze application operations like HTTP requests or database queries using specified name and operation type.
Instructions
Start a performance monitoring transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | Transaction description | |
| name | Yes | Transaction name | |
| op | Yes | Operation type (e.g., 'http.request', 'db.query') |
Implementation Reference
- src/index.ts:854-877 (handler)The handler for the 'sentry_start_transaction' tool. It ends any existing transaction, starts a new one using Sentry.startSpan with the provided name and op, stores it in currentTransaction, and returns a confirmation message.case "sentry_start_transaction": { const { name: transactionName, op, description } = args as any; if (currentTransaction) { currentTransaction.end(); } currentTransaction = Sentry.startSpan( { name: transactionName, op }, () => { // Transaction is active here return null; } ); return { content: [ { type: "text", text: `Transaction started: ${transactionName} (${op})`, }, ], }; }
- src/index.ts:260-281 (schema)The tool definition including name, description, and input schema for 'sentry_start_transaction' in the list of tools returned by ListToolsRequestHandler.{ name: "sentry_start_transaction", description: "Start a performance monitoring transaction", inputSchema: { type: "object", properties: { name: { type: "string", description: "Transaction name", }, op: { type: "string", description: "Operation type (e.g., 'http.request', 'db.query')", }, description: { type: "string", description: "Transaction description", }, }, required: ["name", "op"], }, },
- src/index.ts:706-706 (helper)Global variable used to store the current active transaction/span, enabling the finish_transaction tool to end it.let currentTransaction: any | null = null;