Repository navigation
Track server Instance ID in BuildMetrics BES event - #29817
Closed
alexander-scott wants to merge 1 commit into
Closed
alexander-scott wants to merge 1 commit into
alexander-scott wants to merge 1 commit into
Conversation
BuildMetrics BES event
alexander-scott
marked this pull request as ready for review
June 19, 2026 08:45
Member
|
I think I would prefer exposing the instanceId, see |
alexander-scott
force-pushed
the
track_previous_server_invocation_id_in_bes_event
branch
from
July 8, 2026 01:17
14156b6 to
eaa0988
Compare
BuildMetrics BES eventBuildMetrics BES event
Contributor
Author
|
Hi @meisterT, I've updated the PR based on your feedback. |
To help debug incrementality or performance issues, it's often handy to work out which invocations ran on the same Bazel server as my build. Expose the server's instance UUID in BuildMetrics.CumulativeMetrics, alongside the other server-lifetime metrics. Invocations that report the same instance_id shared a server (and therefore its incremental state), which makes it possible to fetch and diff stats/metrics/inputs/outputs against earlier invocations on the same server. The instance ID was previously created in BlazeRuntime.Builder.build() and only handed to modules via blazeStartup(); it is now also retained on BlazeRuntime with a getter, so it can be read anywhere the CommandEnvironment is available.
alexander-scott
force-pushed
the
track_previous_server_invocation_id_in_bes_event
branch
from
July 8, 2026 04:29
eaa0988 to
281c49f
Compare
meisterT
approved these changes
Jul 8, 2026
copybara-service Bot
pushed a commit
to bazelbuild/intellij
that referenced
this pull request
Jul 15, 2026
โฆl#29817) ### Description This PR adds a new field to the `CumulativeMetrics` message that belongs to the `BuildMetrics` BES event. The field is named `instance_id`, and is simply the instance ID of the current running server. It will persist across builds on the server, but if the server is killed and restarted, it will be a cold start and therefore have a brand new instance ID. ### Motivation To help debug incrementality or performance issues, it's often handy to work out what ran on the Bazel server directly before my build. Tracking this allows us to fetch metrics/logs for invocations that ran on the server with this instance ID and diff stats/metrics/inputs/outputs to understand why the current build behaved the way it did. The instance ID and also the previous invocation ID is already available in the server log, but putting it here as well alongside the other cumulative metrics makes it even more accessible. ### Build API Changes No ### Checklist - [x] I have added tests for the new use cases (if any). - [x] I have updated the documentation (if applicable). ### Release Notes RELNOTES: Added a new `instance_id` field to the `BuildMetrics` BES event, in order to help diff between the current and previous builds on the running server. Closes #29817. PiperOrigin-RevId: 948419715
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new field to the
CumulativeMetricsmessage that belongs to theBuildMetricsBES event. The field is namedinstance_id, and is simply the instance ID of the current running server. It will persist across builds on the server, but if the server is killed and restarted, it will be a cold start and therefore have a brand new instance ID.Motivation
To help debug incrementality or performance issues, it's often handy to work out what ran on the Bazel server directly before my build. Tracking this allows us to fetch metrics/logs for invocations that ran on the server with this instance ID and diff stats/metrics/inputs/outputs to understand why the current build behaved the way it did.
The instance ID and also the previous invocation ID is already available in the server log, but putting it here as well alongside the other cumulative metrics makes it even more accessible.
Build API Changes
No
Checklist
Release Notes
RELNOTES: Added a new
instance_idfield to theBuildMetricsBES event, in order to help diff between the current and previous builds on the running server.