[SVLS-5506] Update cloud run tags to also account for Cloud Run Functions and Namespace#30722
Conversation
Test changes on VMUse this command from test-infra-definitions to manually test this PR changes on a VM: inv create-vm --pipeline-id=48583022 --os-family=ubuntuNote: This applies to commit 5f140e2 |
Regression DetectorRegression Detector ResultsMetrics dashboard Baseline: 2e1024b Optimization Goals: ✅ No significant changes detected
|
| perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
|---|---|---|---|---|---|---|
| ➖ | basic_py_check | % cpu utilization | +2.73 | [-1.29, +6.75] | 1 | Logs |
| ➖ | pycheck_lots_of_tags | % cpu utilization | +0.64 | [-2.69, +3.97] | 1 | Logs |
| ➖ | otel_to_otel_logs | ingress throughput | +0.44 | [-0.24, +1.12] | 1 | Logs |
| ➖ | file_to_blackhole_1000ms_latency | egress throughput | +0.36 | [-0.12, +0.84] | 1 | Logs |
| ➖ | file_to_blackhole_0ms_latency | egress throughput | +0.02 | [-0.45, +0.49] | 1 | Logs |
| ➖ | tcp_syslog_to_blackhole | ingress throughput | +0.01 | [-0.04, +0.06] | 1 | Logs |
| ➖ | quality_gate_idle | memory utilization | +0.01 | [-0.04, +0.06] | 1 | Logs bounds checks dashboard |
| ➖ | tcp_dd_logs_filter_exclude | ingress throughput | +0.00 | [-0.01, +0.01] | 1 | Logs |
| ➖ | uds_dogstatsd_to_api | ingress throughput | +0.00 | [-0.07, +0.07] | 1 | Logs |
| ➖ | file_to_blackhole_100ms_latency | egress throughput | -0.03 | [-0.34, +0.29] | 1 | Logs |
| ➖ | file_to_blackhole_300ms_latency | egress throughput | -0.04 | [-0.22, +0.15] | 1 | Logs |
| ➖ | file_to_blackhole_500ms_latency | egress throughput | -0.06 | [-0.31, +0.18] | 1 | Logs |
| ➖ | file_tree | memory utilization | -0.10 | [-0.22, +0.02] | 1 | Logs |
| ➖ | quality_gate_idle_all_features | memory utilization | -0.28 | [-0.38, -0.18] | 1 | Logs bounds checks dashboard |
| ➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | -1.46 | [-2.19, -0.73] | 1 | Logs |
Bounds Checks: ❌ Failed
| perf | experiment | bounds_check_name | replicates_passed | links |
|---|---|---|---|---|
| ❌ | quality_gate_idle | memory_usage | 6/10 | bounds checks dashboard |
| ❌ | file_to_blackhole_0ms_latency | lost_bytes | 9/10 | |
| ❌ | file_to_blackhole_100ms_latency | lost_bytes | 9/10 | |
| ✅ | file_to_blackhole_0ms_latency | memory_usage | 10/10 | |
| ✅ | file_to_blackhole_1000ms_latency | memory_usage | 10/10 | |
| ✅ | file_to_blackhole_100ms_latency | memory_usage | 10/10 | |
| ✅ | file_to_blackhole_300ms_latency | memory_usage | 10/10 | |
| ✅ | file_to_blackhole_500ms_latency | memory_usage | 10/10 | |
| ✅ | quality_gate_idle_all_features | memory_usage | 10/10 | bounds checks dashboard |
Explanation
Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%
Performance changes are noted in the perf column of each table:
- ✅ = significantly better comparison variant performance
- ❌ = significantly worse comparison variant performance
- ➖ = no significant change in performance
A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".
For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.
-
Its configuration does not mark it "erratic".
…ctions-origin-tag-to-cloudrun' into nina.rei/SVLS-5506/cloud-run-functions-origin-tag-to-cloudrun
…n-tag-to-cloudrun
| functionTargetEnvVar = "FUNCTION_TARGET" // exists as a cloudrunfunction env var for all runtimes except Go | ||
| ) | ||
|
|
||
| const ( |
There was a problem hiding this comment.
nit: this can probably just move to the other constants. Differentiating them with a comment is sufficient.
|
|
||
| // CloudRun has helper functions for getting Google Cloud Run data | ||
| type CloudRun struct { | ||
| spanNamespace string |
There was a problem hiding this comment.
This works well also, but I’m curious if by making everything constants as I stated earlier, you could have stuck with the original cloudRunFunctionMode bool. This way you could use the gcr constants as default and switch to the gcrfx ones if cloudRunFunctionMode=true. I think this would be easier to read as well. Can you help explain why my suggestions wouldn’t work and why you chose this approach instead?
| cloudRunService = "gcr." | ||
| cloudRunFunction = "gcrfx." |
There was a problem hiding this comment.
This all looks great, but I feel it might have been simpler to read if you had set these as full constants, like gcrf.function_target. Can you help me understand why appending the prefix each time you set a tag is the better approach in this case?
There was a problem hiding this comment.
I can update the code with constants instead. I went with namespace prefix + tag name instead of a constant namespace tag because of the region and project_id tags. This would require a larger code refactor to check for cloudRunFunctionMode outside of cloudrun file instead of passing in the namespace prefix to the TagMap function in gcp.go. But I agree your approach is easier to read
|
/merge |
Devflow running:
|
What does this PR do?
Update cloud run origin tag to also account for Cloud Run Functions by setting the origin tag always to
cloudrunUpdates tags to include namespace prefix
gcrfor Cloud Run Services andgcrfxfor Cloud Run FunctionsAll spans will be tagged with:
origin_dd.origin_dd.datadog_sidecar_versionDuplicate tags for the overlying cloud run service for both namespaces:
gcrfx.revision_namegcrfx.service_namegcrfx.configuration_namegcrfx.regionregiontag remainsgcr.container_idcontainer_idtag remainsgcr.project_idproject_idtag remainsAdditional tags only for Cloud Run Functions:
gcrfx.function_targetgcrfx.function_signature_typeMotivation
Based on this PR #29404
This Jira Ticket
Describe how to test/QA your changes
updated tests for
cloudrun.gofile incloudrun_tests.goand tests for
gcp.gofile ingcp_tests.goPR was tested with serverless-init release candidate gcr-tag-rc1 results are shown in the image below
Possible Drawbacks / Trade-offs
we will need
function_targettag to differentiate cloud run services vs cloud run functionsAdditional Notes