Index of every page on this site: llms.txt
All skills
github avatar

/spring-observability

@f10fdb8 official
by githubgithub/awesome-copilot42k stars
5,426
Run it yourself

Add and review observability in Spring Boot 3/4 apps: Actuator exposure and health probes, Micrometer metrics, Observation API, OpenTelemetry tracing and OTLP/Prometheus export, structured logging with correlation ids, and safe use of heapdump/threaddump. Use when instrumenting, monitoring or troubleshooting a Spring Boot service.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/spring-observability

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencestracing-observation.md

≈698 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Observation API and tracing

Observation API

One instrumentation point produces metrics and traces (Micrometer Observation).

@Service
class OrderService {
    private final ObservationRegistry registry;
    OrderService(ObservationRegistry registry) { this.registry = registry; }

    Order place(Order o) {
        return Observation.createNotStarted("order.place", registry)
            .lowCardinalityKeyValue("channel", o.channel())      // metric + span tag
            .highCardinalityKeyValue("order.id", o.id())         // span tag only
            .observe(() -> doPlace(o));
    }
}

Or annotate with @Observed(name = "order.place") and register an ObservedAspect bean (needs spring-boot-starter-aop/AspectJ on the classpath; Boot 4 names it spring-boot-starter-aspectj). Customize via ObservationFilter, ObservationPredicate, and ObservationConvention beans.

Tracing with OpenTelemetry

Boot 3.x (bridge to the OTel SDK):

  • io.micrometer:micrometer-tracing-bridge-otel and io.opentelemetry:opentelemetry-exporter-otlp (versions managed by Boot).

Boot 4.x:

  • org.springframework.boot:spring-boot-starter-opentelemetry (documented as the OpenTelemetry starter for traces, metrics, logs via OTLP). Zipkin: spring-boot-starter-zipkin.
  • Modular artifacts exist (spring-boot-micrometer-tracing-opentelemetry, spring-boot-opentelemetry), but prefer starters. Verify names against your Boot version's reference docs.
management:
  tracing:
    sampling:
      probability: 1.0        # default 0.1; use 1.0 only in dev/test
  # Boot 3.5:
  otlp:
    tracing:
      endpoint: http://localhost:4318/v1/traces
  # Boot 4.0 (replaces the block above):
  # opentelemetry:
  #   tracing:
  #     export:
  #       otlp:
  #         endpoint: http://localhost:4318/v1/traces
spring:
  application:
    name: orders               # becomes service.name
  • Propagation defaults to W3C traceparent; management.tracing.propagation.type can add B3.
  • Auto-instrumented: Spring MVC/WebFlux and RestClient, RestTemplate, WebClient built from the injected builders. JDBC needs additional instrumentation such as datasource-micrometer.
  • Messaging observations require an explicit opt-in. For Kafka, enable both spring.kafka.template.observation-enabled=true and spring.kafka.listener.observation-enabled=true (both default to false) to create producer/listener spans and propagate tracing context. For RabbitMQ or another messaging technology, check its version-specific template/listener observation settings rather than assuming tracing dependencies enable them.
  • Local backends: Zipkin, Jaeger, or Grafana LGTM via Testcontainers/spring-boot-docker-compose in dev only.
  • Do not put PII or secrets in span attributes.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert5d3 checks · Risk SAFE
  • Gen Agent Trust Hub5d

    The skill provides comprehensive guidelines for implementing and managing observability in Spring Boot applications. It follows secure defaults, includes explicit safety warnings regarding sensitive data (secrets, heap dumps), and recommends official or well-known community tools for development. No malicious patterns or security risks were detected.

  • Socket20d

    No alerts

  • Snyk5d

    Risk: CRITICAL · 2 issues

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated last month

README badge

README badge for github/awesome-copilot/spring-observability