Skip to content

fix: group otlp batch by resource identity instead of using first event#158

Merged
HugoRCD merged 1 commit intoHugoRCD:mainfrom
shubh73:fix/otlp-batch-resource-grouping
Mar 10, 2026
Merged

fix: group otlp batch by resource identity instead of using first event#158
HugoRCD merged 1 commit intoHugoRCD:mainfrom
shubh73:fix/otlp-batch-resource-grouping

Conversation

@shubh73
Copy link
Copy Markdown
Contributor

@shubh73 shubh73 commented Mar 9, 2026

📚 Description

sendBatchToOTLP uses the first event's resource attributes for all events in the batch. When a batch contains events from multiple services or environments (e.g. a queue consumer or telemetry relay) every event gets the first event's service.name and deployment.environment — so logs from payments show up as auth.

We hit this in production running a workers queue consumer that aggregates events from multiple services and flushes them in a single sendBatchToOTLP call. We had to inline the otlp adapter in our app to work around it.

This PR groups events by (service, environment) before building the payload, so each group gets its own resourceLogs entry with correct resource attributes.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Note

This PR was written with AI assistance.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 9, 2026

@shubh73 is attempting to deploy a commit to the HRCD Projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the bug Something isn't working label Mar 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

Thank you for following the naming conventions! 🙏

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 10, 2026

npm i https://pkg.pr.new/evlog@158
npm i https://pkg.pr.new/@evlog/nuxthub@158

commit: bb52dd7

@HugoRCD HugoRCD merged commit d474281 into HugoRCD:main Mar 10, 2026
11 of 12 checks passed
@shubh73 shubh73 deleted the fix/otlp-batch-resource-grouping branch March 11, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants