Product release metrics¶
Use mise run dora to inspect the latest locally available product tag or a selected tag.
The report shows the release cut, commits compared with the prior cut, and delivery
milestones in each production region. Use Release journey to
investigate staging and validation waits.
This is a release-focused DORA view. It measures change ages for one release. Deployment frequency and incident-based stability measures require a history of releases and are outside this report.
GitLab deployment records: Manage Core pilot¶
Manage Core's downstream deploy/check jobs publish deployment records in
evenergi/develop. Builds, Terraform state, CI variables and deployment execution
remain in the downstream project. This instrumentation is separate from mise run dora.
| Upstream environment | GitLab tier |
|---|---|
development/manage-core/ap-southeast-2 |
development |
staging/manage-core/ap-southeast-2 |
staging |
production/manage-core/ap-southeast-2 |
production |
production/manage-core/ca-central-1 |
production |
production/manage-core/eu-west-2 |
production |
production/manage-core/us-west-1 |
production |
The downstream environment names stay develop, staging and production because
they select Terraform state and scoped configuration. Check jobs use action: verify;
they no longer create a second downstream deployment. Downstream apply records remain
available to release discovery. Query the monorepo project for canonical counts;
aggregating both projects would count the same deployment twice.
The pilot counts ECS application rollouts, not infrastructure changes or feature
exposure. The deploy job observes ECS before and after apply. A changed ECS deployment
ID using the intended product image starts one upstream record with status running.
Apply success alone never marks that upstream record successful. An infrastructure-only
apply or retry with the same ECS deployment ID creates no record. A forced rollout or
rollback with a new ECS deployment ID can count even when the task ARN or source SHA
is unchanged. Feature flags and release/exposure decisions are outside this metric.
Records use MONOREPO_SOURCE_SHA and MONOREPO_SOURCE_REF, never the downstream
bootstrap commit. Sparse checkout must verify that source. Legacy pipelines without
monorepo identity log an explicit skip. Missing before/after evidence, an image mismatch
or an observation predating the apply leaves metrics unavailable; do not guess attribution.
Initial provisioning without a readable pre-existing ECS service is outside this pilot.
Plan, apply and check jobs retain trunk's Terraform commands, inputs and artifacts.
The plan additionally passes the intended image for attribution. The deploy job adds a
small ECS receipt and the upstream record ID. These new telemetry artifacts contain no
Terraform output dump or container environment values; existing Terraform artifacts keep
their existing upload policy. Core's recording target mapping in
production-deployment-record.gitlab-ci.yml defines cluster/service names; keep it aligned
if infrastructure naming changes. Checks retain their Terraform-provided configuration.
The existing validators own ECS stability, API version, migrations and configured
load-balance checks. A new ECS rollout receipt disables their task-ARN no-op shortcut
and selects startup logs from ECS creation time, so forced rollouts receive validation.
Without a new rollout receipt, their existing no-op behaviour remains. If optional
recording failed, normal delivery checks continue without publishing a metric.
Checks preserve the validator's bounded wait when ECS still reports the previous task.
They capture the first matching rollout ID/task ARN and require the same identity
after service validation, even without a metrics receipt. An unchanged observer receipt
does not bind checks to the previous rollout; the metric remains unavailable if a new
rollout was not observed after apply. A verified new receipt must match the checked rollout.
A replacement rollout fails
validation. The check job's after_script publishes its success, failure or cancellation
to the running record created beside apply. The reporter consumes that result without
repeating ECS validation. Reporting errors cannot change the check result; see
GitLab after_script. Runner loss,
timeouts or cancellation can prevent reporting and leave the record incomplete.
Check retries reuse the upstream ID;
an already successful record remains successful without another write.
Enable and verify¶
- For metrics collection, confirm
evenergi/vemo/vemo-coreis onevenergi/develop's job-token allowlist, with repository-file read and environment/deployment API access. The pipeline actor must also have permission to create environments and deployments. No new long-lived secret is required. See GitLab job-token access. - Merge the helper and CI changes together. Downstream jobs fetch the reporter from
monorepo
mainand pass that exact copy to checks, so older service tags work too. Reporting is best-effort: missing permissions, setup/download failures and API errors log warnings and do not fail deployment or check jobs. Before-apply setup/observation and after-apply creation each have a 30-second deadline; success/failure updates have a 15-second deadline. Terraform apply and service validation errors still fail their jobs and retain existing gates. - On the next normal development deployment, compare the upstream environment, SHA, ref and status with the ECS receipt and downstream checks. Confirm one success, no second record on a check/apply retry without a new ECS rollout, and no record for an infrastructure-only apply. Check artifacts on successful and failed jobs for credential exclusion. Exercise delayed checks against a superseding rollout, including an unchanged task ARN, and verify metrics/API failures cannot block valid delivery.
- Repeat on staging, then inspect the next authorized production deployment in each region. Check the deployment's associated MRs and native lead-time result before treating source attribution as verified. Native MR association is not service-path filtering: a monorepo commit can contain changes to other services. Treat the first record as a baseline: GitLab may associate older merged MRs when there is no previous deployment. Verify that association before using the first lead-time sample.
For this pilot, Emilian Roman, as infrastructure lead, owns the merge decision, rollout
and end-to-end verification. Before merge, inspect compiled downstream jobs, artifact
contents, image propagation and token scopes. Existing GitLab approval requirements apply.
The optional observer needs
ecs:DescribeTaskDefinition on the apply identity; checks retain their existing ECS reads.
Before onward release,
Emilian must verify development/staging runs and existing staging promotion
check discovery. Drain or account for older queued applies that lack the new resource
groups before testing overlap guarantees. Inspect each region's first authorized
production record before relying on its telemetry.
GitLab's default DORA scope uses production-tier environments. This pilot counts regional service deliveries: a release delivered to four regions produces four records. Failed jobs are not incident evidence; change-failure and recovery metrics still need the incident workflow. See GitLab DORA definitions.
Recover incomplete recording¶
Inspect the deploy job's deployment-record.json artifact and GitLab record before
retrying. Artifacts expire after one day. The artifact contains source/target identity,
downstream pipeline/job IDs, ECS rollout identity and the upstream deployment ID; it contains no credentials.
- If apply failed, the after-apply observer does not run and no new record is created. Inspect ECS manually if the failed apply partially deployed the application.
- If validation failed, retry the check job while its deploy artifacts remain available. If only its success update failed, delivery continues; reconcile the record from check evidence or retry checks while the target is still current. Do not rerun apply merely to repair reporting. A missing handle requires manual reconciliation, not a check retry.
- If cancellation, runner loss or a callback API error leaves a record
running, an operator must reconcile it against deploy/check evidence using the Deployments API. Job-token cancellation invalidates the token;after_scriptcannot guarantee terminal status delivery. - If creation was accepted but its response was lost, the artifact has attempt identity without an ID. Find the record by environment, SHA and attempt time before any repair; do not blindly create another. Delivery continues even when recording fails, so inspect the actual deployment and validation results before assigning a terminal status.
- After artifacts expire, reconcile manually from retained GitLab job/deployment evidence. Do not infer success from a successful build or Terraform plan.
There is no backfill or scheduled reconciliation in this pilot. Reverting the CI/helper change stops future upstream recording; existing records remain for audit. Customer Help and release notes are unaffected because this changes internal delivery telemetry only.
Run¶
Use an AWS session for the production account and a complete local monorepo checkout with release tags. Git queries are local; the report does not call GitLab or fetch refs.
Install the locked runtime dependencies after updating the tool. Keep any additional development packages already installed:
# Latest local annotated product tag, across configured production regions.
mise run dora
# Select a tag and optionally a different comparison tag or region.
mise run dora --tag 2026.46.0.2b152976
mise run dora --tag 2026.46.0.2b152976 --base-tag 2026.45.2.3f0b495e
mise run dora --region ca-central-1 --aws-profile production
# Trace collection costs, save evidence, or reopen it offline.
mise run dora --timings --output /path/in/approved-storage/dora.json
mise run dora --input /path/in/approved-storage/dora.json
mise run dora --demo
Repeat --region to select several regions. --repo selects another local monorepo.
Deployment regions are ap-southeast-2, ca-central-1, eu-west-2 and us-west-1. Global frontend
evidence is always collected, including when --region selects only one region.
--no-browser prints the URL; --port selects a local port. The server binds to
127.0.0.1 and requires the URL's private session token. Stop with Ctrl+C.
--output saves and exits. Snapshots do not refresh.
The previous period and service filters are removed. The selected tag defines scope; every production service in a collected region can supply its delivery milestone. The dashboard region filter changes only the view. Regional spread uses every collected region. Manage Web and Fleet Roaming appear as Global service in each regional view, with the same timestamps and lead times. Their evidence is collected and saved once. The us-east-1 bucket location is not a separate deployment region in the dashboard.
Read the report¶
- Check Release cut: the selected tag, its creation time and the comparison tag.
- Compare regional median and p90 Release change lead time.
- Read Regional delivery for the timestamp, tag-to-milestone duration and service supplying the latest timestamp. Commit → deployment shows median and p90 change lead time plus the commit count, using the same format as the service table. Expand the evidence to see service coverage.
- Use Service delivery time to compare each service independently. Tag → deployment bars start at the selected tag's creation and end at that service's milestone. All collected regions share one scale, retained when filtering regions. Commit → deployment shows median and p90 change lead time. Rows remain in milestone order; gaps from the previous service are secondary comparisons and do not imply dependencies.
- Inspect Changes represented by this release for every included commit, its committer timestamp and regional change age. Missing evidence is Unknown, never zero.
Calculation¶
Product tags follow the existing YYYY.WW.N.<8-character SHA> convention. By default,
select the latest local annotated product tag by tagger timestamp. Compare it with the
annotated product tag having the immediately preceding creation timestamp. --base-tag
overrides the comparison. Branch divergence does not change this chronological selection.
Annotated tags supply an actual recorded tagger timestamp. An explicitly selected
lightweight tag has no recorded creation time: show Unknown, do not substitute the
commit date, and require --base-tag for its commit comparison. Local tags must be current
and immutable; the report cannot identify a newer remote tag that has not been fetched.
Git returns non-merge monorepo commits reachable from the selected tag but not from the comparison tag. Shared libraries, infrastructure, documentation and service changes all contribute. There is one local Git traversal for the release comparison, shared by regions. Missing source objects or a shallow checkout leave commit metrics unknown.
For each ECS service and region, find the latest available task definition using the selected image tag. For Manage Web and Manage Roaming, use the S3 release marker described below. The regional milestone is the latest of those matching service timestamps. Global frontend milestones contribute to every regional summary. A later global milestone can set several regional completion times; an unreadable global service makes each regional summary incomplete. Commit samples remain counted once per regional summary. For example, Core at 10:00 and Telematics at 10:09 yield 10:09. A service with no matching milestone does not block the regional result; a service that cannot be read makes regional metrics unknown because it might supply a later timestamp.
| Measure | Rule |
|---|---|
| Release change lead time | Regional milestone minus Git committer timestamp, for each commit in the selected comparison. |
| Median / p90 | Linear interpolation over valid commit ages. Negative intervals are excluded. |
| Tag → milestone | Regional milestone minus the selected annotated tag's creation time. |
| Regional spread | Latest minus earliest milestone across all collected regions; missing or unreadable regions leave it incomplete. |
| Service change lead time | Each service's milestone minus each Git committer timestamp, using the same monorepo comparison for every service. |
| Tag → deployment bar | Service milestone minus the selected tag's creation time. Bars share a zero origin and a maximum across all collected services and regions. Unknown tag creation time leaves the bar unavailable. |
| Gap from previous | Service milestone minus the immediately preceding observed milestone. Ties have zero gap; the first has no preceding gap. |
The service view reuses collected timestamps; it adds no AWS or Git requests. It does not filter commits by service paths. Gaps describe milestone order, not service execution durations or proof of sequential pipeline dependencies. A large gap identifies where to inspect the pipeline; it does not establish which job caused the wait.
Missing service timestamps make the sequence partial. A readable service keeps its own metrics even if another service failed collection. Missing Git history suppresses change lead times but leaves milestone gaps available. Negative commit ages are excluded at each service's timestamp, so sample counts can differ.
This is a comparison of two named cuts, not a search for first delivery across all release history. Commits in the prior tag are excluded. Reintroduced commits absent from that prior tag can contribute even if a different older release contained them. Selecting a different comparison tag changes the sample set. Re-registering or re-uploading the selected tag moves its milestone.
Services can run different product tags. ECS registration and S3 publication are consistent deployment proxies for comparing delivery times; neither proves customer exposure.
S3 frontend publication¶
Read the global services' version.json from manage.betterfleet.com (Manage Web) and
charge.betterfleet.com (Fleet Roaming, identified as manage-roaming in saved evidence).
Both buckets are hosted in us-east-1. Their pipelines explicitly upload this marker
after syncing the bundle. Match its version and commit to the selected tag and use the
same response's S3 LastModified timestamp. Ignore built_at, which precedes the build.
The service table labels this evidence S3 marker upload and Global service.
Each service adds one small GetObject request, using s3:GetObject permission on its
marker, with standard S3 request/data charges. No bucket scan or deployment change is needed.
Manage Web uploads index.html immediately afterward; the marker remains the consistent
measurement point. Only the current marker is read. A different version supplies no match;
conflicting commit identity, missing markers or failed reads leave evidence unavailable.
Overwritten historical tags require saved snapshots; this collector does not scan object versions.
Collection and performance¶
The production pipeline owns the service/region inventory. Exact task-family mappings in
dora_sources.py exclude staging. Explicit frontend bucket mappings cover us-east-1;
other targets without a supported source remain unknown.
Each region reuses an AWS SDK client per source type (ECS or S3), with connection pooling and the normal
AWS credential chain. The runtime includes CRT support for aws login profiles. The
collector reads at most four regions concurrently, with up to four task-definition reads
per region. It does not launch an AWS CLI process per request.
ListTaskDefinitions enumerates ACTIVE and INACTIVE revisions. DescribeTaskDefinition
reads them in descending revision batches until the latest matching registration is found,
or the scan crosses the annotated tag's creation time. Definitions created before that cut
are outside the search after this boundary. Explicit lightweight tags have no creation
boundary and can require a full scan. Older selected tags can also require more reads.
A batch can read up to three additional definitions beyond the match or boundary.
AWS only exposes INACTIVE definitions while an active task or service references them. Deleted or unavailable definitions cannot be reconstructed. See the AWS listing contract.
--timings prints local Git time, AWS wall time (aws_seconds), calculation time and total
command work, plus list-page requests, definition reads, S3 reads and retries. The AWS time
replaces ecs_seconds in new snapshots and includes credentials,
connection setup and retries. When reopening a snapshot, saved collection diagnostics
refer to the original collection; calculation and total time refer to the current run.
No request bodies, credentials or container configuration are logged.
Snapshot compatibility¶
Version 3 snapshots reopen without Git or AWS reads. They contain only the selected release and cannot be retargeted; collect another snapshot for a different tag or comparison. Saved frontend evidence under us-east-1 is shared across the saved regional views on load. A snapshot containing only those frontends shows a Global services view. Snapshots that never collected the frontends cannot supply their timestamps; collect again to include them. Snapshots without individual service timestamps still show regional metrics. The service sequence marks those timestamps unknown rather than inferring them from the regional total.
Version 1 service snapshots and version 2 product-history snapshots are converted using
saved registration evidence and local Git. The default is the latest local annotated product
tag represented in that snapshot; --tag can select another. Registration coverage remains
limited to the saved evidence. The input file is unchanged and the report displays the limit.
Snapshots retain tag identities, timestamps, observed services, task/object ARNs and commit metadata. They do not retain container configuration, environment values or secret references. Keep snapshots in approved internal storage and out of Git.
Verification¶
tests/dora_test.py owns tag selection, prior-cut comparison, bounded registration scanning,
S3 marker identity and upload timestamps,
regional aggregation, incomplete evidence, snapshot conversion and browser coverage. Run
release-journey regression coverage because the dashboards share its local HTTP handler.
uv run --frozen --no-dev --with playwright==1.64.1 playwright install chromium --only-shell
uv run --frozen --no-dev --with pytest --with playwright==1.64.1 pytest -q tests/dora_test.py tests/release_journey_test.py
uvx --from ruff==0.15.12 ruff check bfd-scripts/scripts/dora*.py tests/dora_test.py --select E,F,I,C901 --ignore E501
uvx --from ty==0.0.75 ty check bfd-scripts/scripts/dora*.py
node --check bfd-scripts/scripts/dora_assets/app.js
uv run --frozen --no-sync python docs_management/scripts/validate_docs_ontology.py
The root type-check dispatcher has no BFDev harness selector; run pinned ty directly.