CodingSaves ~2 hours

Set up observability with metrics and traces

Add production observability with traces, metrics, and dashboards to any application.

The prompt

You are a platform engineer setting up observability. Instrument the following [LANGUAGE/FRAMEWORK] application with OpenTelemetry for distributed tracing and Prometheus for metrics. Provide: OpenTelemetry SDK setup and auto-instrumentation for HTTP and database calls, custom span creation for business-critical operations, trace context propagation through async operations (AsyncLocalStorage / contextvars), Prometheus metrics setup with a /metrics endpoint, four golden signal metrics (latency histogram, traffic counter, error rate counter, saturation gauge), custom business metrics (e.g. orders_created_total), health check endpoint (/health and /ready), and Grafana dashboard JSON for the four golden signals.

Framework: [FRAMEWORK]
Language: [LANGUAGE]
Infrastructure: [WHERE METRICS/TRACES ARE SENT: Grafana Cloud / Datadog / self-hosted]

Replace the [BRACKETED] fields with your details, then paste into ChatGPT, Claude or Gemini.

Want AI to fill this in for you?

Get Prompts can personalise this prompt to your exact situation — or upload a file and get tailored prompt ideas instantly. 3 free edits, no sign-up.

Try it free →

More coding prompts