Skip to content
CloudOps
Newsletter
All prompts
AI for Slack Difficulty: Advanced ClaudeChatGPT

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.
Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 1,603 DevOps AI prompts
  • One practical workflow email per week