bazelbuild / bazelbuild/bazel

Integrate with OpenTelemetry

Open
#19,158 6 comments 9 reactions 0 assignees View on GitHub
not stale P3 team-OSS team-Performance type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

We're interested in having Bazel integrate with OpenTelemetry, with the idea that we'd like each build graph action to open a new span that links to the parent span for the overall Bazel invocation. This way, when our code invokes Bazel (inside an OTel span) and Bazel makes many actions that may invoke OTel-compatible tools we create, we'd be able to link the spans from those child tools to the specific Bazel action that spawned them rather than the overall Bazel process.

We recognize that the JSON profiles and the BEP provide two other ways to get (some of) this information, and that that might make implementing this third alternative somewhat unappealing. But Open Telemetry would let us link the processes Bazel invokes into the overall graph in a way that I don't believe those other two mechanisms can support, so we think it could still provide value despite the similarity to those other features.

### Which category does this issue belong to?

_No response_

### What underlying problem are you trying to solve with this feature?

We want to be able to capture OpenTelemetry traces across our full build, where Bazel will be invoked by scripts above it and will invoke scripts below it, to understand more details about our build's performance than are provided by Bazel's JSON profiling data alone.

### Which operating system are you running Bazel on?

_No response_

### What is the output of `bazel info release`?

_No response_

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?

_No response_

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reviewing how Bazel represents the overall invocation and individual build graph actions, then compare the existing JSON profile and Build Event Protocol mechanisms mentioned in the issue. Define the OpenTelemetry span relationships and integration boundaries needed to connect parent Bazel spans with child tools; done means the scope and implementation path are specified clearly enough to evaluate.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.