Skip to content

docs(apm): get JVM backend exceptions into Issues (Spring + Ktor)#879

Merged
Starefossen merged 1 commit into
mainfrom
docs/apm-jvm-exception-issues
Jul 6, 2026
Merged

docs(apm): get JVM backend exceptions into Issues (Spring + Ktor)#879
Starefossen merged 1 commit into
mainfrom
docs/apm-jvm-exception-issues

Conversation

@Starefossen

Copy link
Copy Markdown
Member

Part of nais/grafana-apm-app#113 (DX & adoption epic #116).

Guide for getting Kotlin/Spring Boot + Ktor exceptions into Nais APM as first-class Issues via the semconv structured-metadata shape (a) — no platform change required:

  • Enable autoInstrumentation: java + OTEL_LOGS_EXPORTER=otlp; the OTel Java agent's Logback appender bridge auto-emits exception.type/message/stacktrace when you log a throwable, and Loki's OTLP endpoint stores them as structured metadata (exception_type etc. — exactly the plugin's parser labels).
  • Log exceptions with the throwable (log.error("...", e), @RestControllerAdvice / Ktor StatusPages), never string-interpolate the stack trace.
  • Field-mapping table + LogQL/Issues-tab verification.

Known limitation flagged in the guide: enabling OTLP export doesn't stop stdout logging, so lines can land in Loki twice (cost), and a JSON-stdout exception can produce a rich shape-(a) issue and a weaker shape-(b) issue that fingerprint differently — a plugin-side dedupe candidate (see #113 follow-up).

Add a how-to showing how Spring Boot (Kotlin/Java) and Ktor services get
their exceptions into the Nais APM Issues tab as first-class issues, by
enabling OTLP log export so the OpenTelemetry Java agent's Logback/Log4j
appender emits exception.type/message/stacktrace as Loki structured
metadata (shape A) instead of sampled plain-text stack traces (shape C).

Includes the semconv-to-Loki field mapping, verification steps, and the
known log-duplication limitation.
@Starefossen Starefossen marked this pull request as ready for review July 6, 2026 06:58
@Starefossen Starefossen merged commit b4b9286 into main Jul 6, 2026
6 checks passed
@Starefossen Starefossen deleted the docs/apm-jvm-exception-issues branch July 6, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant