observability-patterns

Implement structured JSON logging, tracing, metrics, and alerting for Spring Boot.

3|2|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/taipt1504/agent-skills --skill observability-patterns-taipt1504
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: observability-patterns
Source: https://github.com/taipt1504/agent-skills/tree/main/skills/observability-patterns
Command: npx skills add https://github.com/taipt1504/agent-skills --skill observability-patterns-taipt1504

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Spring Boot services often lack cohesive observability, making it difficult to collect structured logs, distributed traces, custom metrics, and reliable health checks in production environments.

Core Features & Use Cases

  • Structured JSON logging with Logstash encoder and MDC context propagation.
  • Distributed tracing via OpenTelemetry and Micrometer bridging.
  • Custom Micrometer metrics (counters, timers, gauges) exposed to Prometheus.
  • Health indicators and Kubernetes liveness/readiness probes.
  • Alerting rules for latency, error rates, JVM heap, and DB pool saturation, integrated with Grafana dashboards.
    These patterns are ideal for backend microservices that require end‑to‑end observability, alerting, and reliable deployment health monitoring.

Quick Start

Use the observability-patterns skill to configure full observability for your Spring Boot project directory.

Frequently Asked Questions about observability-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure structured JSON logging and distributed tracing in Spring Boot?

Structured JSON logging and distributed tracing in Spring Boot are configured using the Logstash encoder for log output and OpenTelemetry with Micrometer bridging for trace context propagation. This ensures logs and traces correlate across microservices.

How do I expose custom Micrometer metrics to Prometheus for a Spring Boot application?

Custom Micrometer metrics like counters, timers, and gauges are exposed to Prometheus by configuring the Micrometer Prometheus registry in your Spring Boot application, allowing Grafana to scrape and visualize the metric data.

Does this observability setup support Kubernetes liveness and readiness probes?

Yes, the observability setup supports Kubernetes liveness and readiness probes by implementing Spring Boot health indicators, enabling reliable deployment health monitoring and automated container orchestration within production environments.

What is the best way to add alerting rules for JVM heap and DB pool saturation in Spring Boot?

The best way to add alerting for JVM heap and DB pool saturation is by exporting custom Micrometer metrics to Prometheus and configuring alerting rules integrated directly with Grafana dashboards for real-time visualization.

Can I use OpenTelemetry with Micrometer for Spring Boot observability?

Yes, you can use OpenTelemetry with Micrometer for Spring Boot observability by utilizing Micrometer bridging to connect distributed tracing data with custom application metrics, providing cohesive end-to-end visibility.

Why do I need MDC context propagation for structured logging in Spring Boot microservices?

MDC context propagation is needed for structured logging in Spring Boot microservices to maintain trace identifiers across asynchronous boundaries, ensuring distributed traces and JSON logs remain correlated end-to-end.