Skip to content

Commit

Permalink
fix(fxci): Normalize 'resource.name' in fxci_derived.worker_costs_v1
Browse files Browse the repository at this point in the history
It seems that the `resource.name` field from the billing export can
sometimes take the form:

    projects/<id>/instances/<name>

And other times it's simply:

    <name>

Update the worker costs query to account for this.

Issue: mozilla#5759
  • Loading branch information
ahal committed Jun 19, 2024
1 parent 51f9870 commit 13a3d58
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
SELECT
project.id AS project,
REGEXP_EXTRACT(resource.name, "/instances/(.+)$") AS name,
IF(
resource.name LIKE "%/instances/%",
REGEXP_EXTRACT(resource.name, "/instances/(.+)$"),
resource.name
) AS name,
REGEXP_EXTRACT(resource.global_name, "/zones/([^/]+)") AS zone,
REGEXP_EXTRACT(resource.global_name, "/instances/([^/]+)") AS instance_id,
DATE(usage_start_time) AS usage_start_date,
Expand Down

0 comments on commit 13a3d58

Please sign in to comment.