Slack App Distributed Tracing Instrumentation Prompt
Instrument a Slack Bolt app with OpenTelemetry traces, metrics, and logs to debug latency across events, actions, and API calls
- Target user
- engineers building Slack ChatOps and bots
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who builds Slack apps and owns observability for a production Bolt service handling events, interactivity, and slash commands. I will provide: - My Bolt runtime (language, Socket Mode or HTTP) and current logging setup - The flows I most need visibility into (e.g. event -> handler -> external API -> chat.postMessage) - My tracing/metrics backend and any cost or cardinality constraints Your job: 1. **Span model** — define the trace and span boundaries for a Slack interaction lifecycle, from request receipt through middleware, handler, downstream calls, and the ack. 2. **Context propagation** — show how to carry trace context across async work and into outbound Web API / external HTTP calls, and how to correlate Slack's retry attempts. 3. **Bolt middleware instrumentation** — design middleware that opens/closes spans and records the ack timing relative to Slack's 3-second deadline. 4. **Attributes and cardinality** — choose safe span attributes (team_id, event type, route) while excluding message content and PII, and budget label cardinality. 5. **Metrics and SLOs** — define RED-style metrics (rate, errors, duration) per route and the alerts that matter (ack-latency breaches, API 429s). 6. **Log correlation** — bind structured logs to trace/span IDs for fast pivoting. 7. **Rollout** — give a low-risk enablement plan with sampling to control cost. Output as: a span/attribute reference table, annotated middleware pseudocode, and a starter set of metrics and alert definitions. Never put message text, user PII, or tokens into span attributes or logs; redact at the instrumentation boundary.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Slack War Room Status Snapshot Bot Prompt
Design a bot that posts a live, auto-refreshing incident status snapshot in the war-room channel — current sev, IC, mitigations in flight, key metrics, and next update ETA — so stakeholders stop interrupting responders.
-
Slack Bookmarks API Channel Quick-Links Automation Prompt
Programmatically curate per-channel bookmark bars so every incident or service channel exposes the same runbook, dashboard, and on-call quick-links via bookmarks.add
-
Slack Pins Lifecycle Hygiene Bot Prompt
Build a bot that auto-pins the canonical incident summary and current status message in a channel, and unpins stale pinned messages once an incident resolves, keeping pinned context noise-free via pins.add and pins.remove
-
Slack Bolt Global Error Handling Strategy Prompt
Design a layered error-handling strategy for a Slack Bolt app — global error listener, per-listener try/catch, user-facing failure UX, retries, and structured logging.
More Slack prompts & error guides
Browse every Slack prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.