Skip to content

buck2_events: Add OpenTelemetry EventSink#1370

Open
9999years wants to merge 1 commit into
facebook:mainfrom
MercuryTechnologies:otel-event-sink
Open

buck2_events: Add OpenTelemetry EventSink#1370
9999years wants to merge 1 commit into
facebook:mainfrom
MercuryTechnologies:otel-event-sink

Conversation

@9999years

Copy link
Copy Markdown
Contributor

This adds a new OtelEventSink which sends InvocationRecord wide events to an OpenTelemetry collector, if configured.

This respects the following environment variables:

  • $OTEL_EXPORTER_OTLP_*
  • $OTEL_SDK_DISABLED
  • $OTEL_SERVICE_NAME
  • $OTEL_RESOURCE_ATTRIBUTES
  • $TRACEPARENT
  • $TRACESTATE

We've been running this patch internally and it works well.

Most of the diff is in app/buck2_events/src/sink/otel_record.rs which is an essentially mechanical translation from InvocationRecords to a set of Otel attributes.

This adds a new `OtelEventSink` which sends `InvocationRecord` wide
events to an OpenTelemetry collector, if configured.

This respects the following environment variables:
- `$OTEL_EXPORTER_OTLP_*`
- `$OTEL_SDK_DISABLED`
- `$OTEL_SERVICE_NAME`
- `$OTEL_RESOURCE_ATTRIBUTES`
- `$TRACEPARENT`
- `TRACESTATE`
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 13, 2026
@meta-codesync

meta-codesync Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D111758706. (Because this pull request was imported automatically, there will not be any future comments.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant