docs(apm): get JVM backend exceptions into Issues (Spring + Ktor)#879
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
autoInstrumentation: java+OTEL_LOGS_EXPORTER=otlp; the OTel Java agent's Logback appender bridge auto-emitsexception.type/message/stacktracewhen you log a throwable, and Loki's OTLP endpoint stores them as structured metadata (exception_typeetc. — exactly the plugin's parser labels).log.error("...", e),@RestControllerAdvice/ KtorStatusPages), never string-interpolate the stack trace.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).