elastic / elastic/ecs-logging-java

Configuration for formatting Throwable stack traces

Open
#103 6 comments 3 reactions 0 assignees View on GitHub
agent-java community
Dominant language
Java
Stars
148
Forks
82
Avg merge
2d 17h
Merged PRs (30d)
3

Description

I'd like to see more options for how stack traces are formatted in the ECS logs to help in reducing the size of logs.

Some examples:

1. Maximum depth
2. Include/exclude stack frames based on a pattern
3. Shorten class names by abbreviating package names to fit within a specified length
4. Root cause first or last

Ideally a configuration option could override the formatting of the stack trace through an interface implementation provided by the application. That implementation could return a `String[]` or `Stream` of the formatted stack frames which are then added to the ECS log either as a JSON string or an array of strings.

I'd be happy to work on a PR for this if there is interest in it being included.

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing ECS Throwable stack-trace formatter and its configuration path. Compare the requested depth, frame filtering, class-name shortening, root-cause ordering, and application-provided formatter interface with the current behavior. Done requires an agreed scope and tests for the selected formatting options and output shapes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.