Skip to content

Add option to emit request logs via OpenTelemetry plugin - #356

Open
Tynopia wants to merge 1 commit into
SAP:mainfrom
Tynopia:otel-emit-request-logs
Open

Tynopia wants to merge 1 commit into
SAP:mainfrom
Tynopia:otel-emit-request-logs

Conversation

@Tynopia

@Tynopia Tynopia commented Sep 18, 2026

Copy link
Copy Markdown
Member

Add option to emit request logs via OpenTelemetry plugin

The OpenTelemetryLogsOutputPlugin currently only forwards message logs; request logs are dropped. This adds setEmitRequestLogs(enabled) to opt into emitting request logs as OTel log records too.

Changes

  • New setEmitRequestLogs(boolean) on OpenTelemetryLogsOutputPlugin — disabled by default, so existing behavior is unchanged.
  • Request logs have no message, so the OTel log body is a short summary of method / request / response_status (e.g. GET /hello 200), falling back to "request".
  • Request fields are forwarded as attributes according to the configured FieldInclusionMode.
  • Added unit tests and updated the output-plugins docs.

Usage

const plugin = new OpenTelemetryLogsOutputPlugin();
plugin.setEmitRequestLogs(true);
plugin.setIncludeFieldsAsAttributes(FieldInclusionMode.AllFields); // optional
log.addOutputPlugin(plugin);

This branch has not been deployed

No deployments
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