Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
oren101ways opened this issue Sep 4, 2024 · 1 comment
Labels
enhancement New feature or request needs triage New issue that requires triage

Comments

@oren101ways
Copy link

oren101ways commented Sep 4, 2024

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

@oren101ways oren101ways added enhancement New feature or request needs triage New issue that requires triage labels Sep 4, 2024
@trask
Copy link
Member

trask commented Sep 4, 2024

sounds a bit similar to open-telemetry/opentelemetry-java#4162 (but applied to log-based exceptions as opposed to span event based exceptions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New issue that requires triage
Projects
None yet
Development

No branches or pull requests

2 participants