Scenario
A microservices-based e-commerce platform runs on Kubernetes. The team experiences intermittent high latency and occasional HTTP 500 errors. They already use Prometheus and Grafana for monitoring but lack distributed tracing, making root cause analysis difficult.
Symptoms
- P99 latency exceeding 2 seconds
- Spikes in 5xx error rates
- Customer complaints about timeouts
Diagnosis
- Check Grafana dashboards for anomaly in
http_requests_duration_seconds_count{status="5xx"}. - Query PromQL:
rate(http_requests_duration_seconds_count{status="5xx"}[5m])to observe error rate trends. - Deploy OpenTelemetry Collector and instrument the application to capture traces. Identify slow spans, e.g., a payment service span taking 800ms.
- Correlate with logs to pinpoint the root cause—a timeout in the payment gateway.
Commands
Deploy OpenTelemetry Collector
helm install otel-collector open-telemetry/opentelemetry-collector -f values.yaml
Instrument Application
Add the OpenTelemetry Java agent:
java -javaagent:opentelemetry-javaagent.jar -jar app.jar
Configure Prometheus
Add a scrape target in Prometheus config:
scrape_configs:
- job_name: 'otel-collector'
static_configs:
- targets: ['otel-collector:8888']
Import Grafana Dashboard
Use Grafana Explore to query traces or import a pre-built OpenTelemetry dashboard.
Risk Controls
- Back up Grafana dashboard JSON and Prometheus config files before changes.
- Deploy the Collector in a separate namespace to avoid service disruption.
- Use canary deployments for application instrumentation; enable OpenTelemetry on a small subset of instances first.
Rollback
- If Collector fails:
helm rollback otel-collector 0 - For application code issues: revert via
git revertand redeploy. - For Prometheus config: restore the backup and reload Prometheus.
Verification
- Verify new traces appear in Grafana Explore.
- Check Prometheus target status:
kubectl port-forward svc/prometheus-server 9090then visit/targets. - Run a load test to confirm reduced latency and error rates.
When to Submit an OpsGlobal Ticket
- Persistent data loss or Collector crashes.
- Need custom instrumentation for non-standard frameworks (e.g., Go, Python).
- Large-scale cluster requiring optimized sampling and storage strategies.
Use cases
Useful for teams handling Observability issues and needing a clear troubleshooting and delivery workflow.
Problem background
Learn how to integrate Prometheus for metrics, Grafana for dashboards, and OpenTelemetry for traces to achieve end-to-end observability in your Kubernetes environment. This guide covers a real-world scenario, diagnostic steps, and operational best practices.
Troubleshooting steps
Confirm impact and recent changes, collect logs, configuration and metrics, then apply fixes from low to high risk.
Command examples
Replace sample resource names with real values and store passwords, tokens and keys in environment variables.
Risks
Before production changes, confirm backups, access boundaries, change windows and rollback paths.
Rollback plan
Keep original configuration and release versions; roll back config, images or database changes if metrics degrade.
Deliverables
Root-cause notes, key commands, remediation steps, verification results and follow-up recommendations.
Need help with a similar technical issue?
If your servers, Kubernetes, Docker, CI/CD, databases or monitoring systems have similar issues, submit logs and config files for remote diagnosis.