Configure Bazel for Hermetiq
Use project-scoped values from Quickstart for BEP ingestion, authentication, profiles, metadata, remote cache, and build grouping.
Your source of truth
Open Quickstart inside the Hermetiq dashboard for the project you are configuring. It generates the correct project ID, service endpoints, credential-helper mappings, and optional cache configuration for that project.
BEP configuration
The core configuration sends BEP events to Hermetiq and associates them with your project. Quickstart also supplies the credential-helper entries used to authenticate the relevant Hermetiq hosts.
build:hermetiq --bes_instance_name=<PROJECT_ID>
build:hermetiq --bes_backend=<BEP_ENDPOINT>
build:hermetiq --bes_timeout=120s
build:hermetiq --bes_results_url=<RESULTS_URL>
build:hermetiq --bes_upload_mode=wait_for_upload_completeWhen entries use the build:hermetiq prefix, activate them with --config=hermetiq. Quickstart can instead generate global build entries if that better fits your Bazel configuration model.
Profile configuration
These Bazel flags produce the profile data used by profile trends, critical-path analysis, parallelism analysis, and profile-derived insights:
build:hermetiq --generate_json_trace_profile
build:hermetiq --experimental_profile_include_primary_output
build:hermetiq --experimental_profile_include_target_label
build:hermetiq --noslim_profileBuild metadata
Add commit, repository, branch, role, or other stable metadata so builds can be filtered and compared in context. Quickstart documents two supported patterns:
- Pass
--build_metadatavalues on the Bazel command line. - Use a workspace-status script and
--workspace_status_command.
Bazel does not perform shell substitution inside .bazelrc, so dynamic values belong in the command line or a script.
Remote cache
Projects using Hermetiq’s remote cache receive the endpoint and instance value in Quickstart. The remote instance name must match the project identity carried by the machine credential.
build:hermetiq --remote_instance_name=<PROJECT_ID>
build:hermetiq --remote_cache=<REMOTE_CACHE_ENDPOINT>Group related invocations
When a CI job runs multiple Bazel commands that belong to one logical build, pass the same --build_request_id to each invocation. Hermetiq can then group them into one build-level record.
# Example: use one ID for build and test invocations in the same CI run
BUILD_ID="${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
bazel build //... --build_request_id="${BUILD_ID}"
bazel test //... --build_request_id="${BUILD_ID}"