https://github.com/scottlepp/tempo-mcp-server
An MCP ( Model Context Protocol ) Server for Grafana Tempo
https://github.com/scottlepp/tempo-mcp-server
agentic-ai agentic-workflow ai go golang grafana grafana-tempo mcp mcp-server tempo
Last synced: 6 days ago
JSON representation
An MCP ( Model Context Protocol ) Server for Grafana Tempo
- Host: GitHub
- URL: https://github.com/scottlepp/tempo-mcp-server
- Owner: scottlepp
- Created: 2025-04-11T16:24:49.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-04-11T21:37:41.000Z (2 months ago)
- Last Synced: 2025-04-11T22:34:59.703Z (2 months ago)
- Topics: agentic-ai, agentic-workflow, ai, go, golang, grafana, grafana-tempo, mcp, mcp-server, tempo
- Language: Go
- Homepage: https://github.com/grafana/tempo
- Size: 12 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-TRACES.md
Awesome Lists containing this project
- awesome-mcp-servers - scottlepp/tempo-mcp-server
README
# Tempo Trace Generator and Query Tools
This directory contains tools for generating test traces in Tempo and querying them through the MCP server.
## Setup
1. **Start Tempo and Grafana:**
```
docker-compose -f docker-compose.test.yml up -d
```This starts:
- Tempo on port 3200 (HTTP API)
- Tempo on port 4317 (OTLP gRPC receiver)
- Grafana on port 30002. **Generate trace data:**
```
./insert-example-traces.sh
```By default, it generates 10 traces spread across several services.
You can configure:
- `NUM_TRACES=20 ./insert-example-traces.sh` (change trace count)
- `SERVICE_NAMES="service1,service2" ./insert-example-traces.sh` (custom service names)3. **Query traces using the MCP server:**
```
./run-client.sh tempo_query "{service.name=\"frontend\"}"
```Other useful queries:
- `./run-client.sh tempo_query "{duration>100ms}"`
- `./run-client.sh tempo_query "{service.name=\"backend\"}"`
- `./run-client.sh tempo_query "{status.code=error}"`## Trace Generator
The trace generator is a Go program that creates realistic distributed traces:
- Creates spans for multiple services (frontend, backend, database, etc.)
- Adds parent-child relationships between spans
- Includes errors in some spans (20% chance per child span)
- Simulates different operation types (compute, io, network, database, external)
- Sets appropriate attributes on spans
- Creates distributed traces that span multiple services## Visual UI
You can access the Grafana UI at http://localhost:3000 to visually explore the traces.
Tempo should be pre-configured as a data source.## Troubleshooting
1. **Cannot connect to Tempo:**
The script will automatically run in Docker if Tempo is detected in Docker. Otherwise,
it will try to connect to the host directly.2. **No traces appear:**
Check Tempo logs:
```
docker-compose -f docker-compose.test.yml logs tempo
```3. **MCP server error:**
Make sure to build the MCP server: `go build -o tempo-mcp-server cmd/server/main.go`