Skip to content

Open io.opentelemetry.instrumentation.logback.appender.v1_0.OpenTelemetryAppender in the library for extension / customisation #12170

Open
@oren101ways

Description

@oren101ways

Is your feature request related to a problem? Please describe.

New Relic have a max length on attributes, and as such long stack traces are getting truncated.

We would like to customise the stack traces (filter lines, limit number of lines, root cause first etc)

Describe the solution you'd like

OpenTelemetryAppender is using LoggingEventMapper internally to omit events. Both classes are completely closed to extensions.

  1. Allow extension of LoggingEventMapper
  2. Add Function<Throwable,String> to LoggingEventMapper.Builder (as default extract current implementation of setThrowable)
  3. change LoggingEventMapper.setThrowable to call the new function: attributes.put(SemanticAttributes.EXCEPTION_STACKTRACE, stacktraceConverter.apply(throwable));
  4. Enable OpenTelemetryAppender configuration, for example:
    overload install method with instance of LoggingEventMapper
    overload start method with instance of LoggingEventMapper

Describe alternatives you've considered

The only alternative is to copy the code of OpenTelemetryAppender and LoggingEventMapper and change it as needed

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions