Skip to content

Add labels to jobs_by_organization#9719

Merged
BenWu merged 2 commits into
mainfrom
benwu/jobs-labels
Jul 23, 2026
Merged

Add labels to jobs_by_organization#9719
BenWu merged 2 commits into
mainfrom
benwu/jobs-labels

Conversation

@BenWu

@BenWu BenWu commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

There are useful labels for auditing where we don't have access to the source projects https://github.com/mozilla/webservices-infra/pull/11890

Reviewer, please follow this checklist

@BenWu
BenWu requested a review from a team as a code owner July 23, 2026 19:43

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds a labels column to monitoring_derived.jobs_by_organization_v1, selecting it from INFORMATION_SCHEMA.JOBS_BY_ORGANIZATION and adding a matching REPEATED RECORD field (key/value STRINGs) to schema.yaml.

The change looks correct: the schema type matches the source column's ARRAY<STRUCT<key STRING, value STRING>> shape, the field ordering in the SELECT matches its position in the schema, and the trailing comma before FROM is valid BigQuery. There is no published view over this table and downstream consumers don't require the new field, so no additional schema updates are needed. I have no findings to raise.

Note: since this only appends a column, historical partitions won't be backfilled with label data — new values will populate going forward (and for the previous day, which main() reprocesses). If backfilled label history is needed, that would require a separate backfill.

@whd whd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Labels are explicit metadata the intended use of which is monitoring so this isn't something that requires additional policy discussion.

@sean-rose sean-rose left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc

bi_engine_statistics.bi_engine_mode AS bi_engine_mode,
bi_engine_statistics.acceleration_mode AS acceleration_mode,
bi_engine_statistics.bi_engine_reasons AS bi_engine_reasons,
labels,

@sean-rose sean-rose Jul 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: With labels now being included in this ETL, the bigquery_usage_v2 ETL should probably be refactored to get labels from this table rather than the JOBS_BY_PROJECT view, because it only queries the JOBS_BY_PROJECT view for the default projects.

@scholtzan

This comment has been minimized.

@scholtzan

Copy link
Copy Markdown
Collaborator

Integration report

@BenWu
BenWu added this pull request to the merge queue Jul 23, 2026
Merged via the queue into main with commit 99c96ca Jul 23, 2026
30 checks passed
@BenWu
BenWu deleted the benwu/jobs-labels branch July 23, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants