Skip to content

Commit 5a56237

Browse files
Remove omitempty for telemetry counters (#2587)
## Why We should send 0 values for counters since that indicates that no instance of the object a counter tracks was found. ## Tests Acceptance tests. Also manually verified that the 0 values indeed show up in the final tables.
1 parent 2c0746b commit 5a56237

File tree

3 files changed

+39
-18
lines changed

3 files changed

+39
-18
lines changed

acceptance/bundle/telemetry/deploy-no-uuid/output.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ Deployment complete!
2222
"bundle_uuid": "[ZERO_UUID]",
2323
"resource_count": 1,
2424
"resource_job_count": 1,
25+
"resource_pipeline_count": 0,
26+
"resource_model_count": 0,
27+
"resource_experiment_count": 0,
28+
"resource_model_serving_endpoint_count": 0,
29+
"resource_registered_model_count": 0,
30+
"resource_quality_monitor_count": 0,
31+
"resource_schema_count": 0,
32+
"resource_volume_count": 0,
33+
"resource_cluster_count": 0,
34+
"resource_dashboard_count": 0,
35+
"resource_app_count": 0,
2536
"resource_job_ids": [
2637
"1"
2738
]

acceptance/bundle/telemetry/deploy/output.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ Deployment complete!
2323
"resource_count": 5,
2424
"resource_job_count": 3,
2525
"resource_pipeline_count": 2,
26+
"resource_model_count": 0,
27+
"resource_experiment_count": 0,
28+
"resource_model_serving_endpoint_count": 0,
29+
"resource_registered_model_count": 0,
30+
"resource_quality_monitor_count": 0,
31+
"resource_schema_count": 0,
32+
"resource_volume_count": 0,
33+
"resource_cluster_count": 0,
34+
"resource_dashboard_count": 0,
35+
"resource_app_count": 0,
2636
"resource_job_ids": [
2737
"1",
2838
"2",

libs/telemetry/protos/bundle_deploy.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ type BundleDeployEvent struct {
44
// UUID associated with the bundle itself. Set in the `bundle.uuid` field in the bundle configuration.
55
BundleUuid string `json:"bundle_uuid,omitempty"`
66

7-
ResourceCount int64 `json:"resource_count,omitempty"`
8-
ResourceJobCount int64 `json:"resource_job_count,omitempty"`
9-
ResourcePipelineCount int64 `json:"resource_pipeline_count,omitempty"`
10-
ResourceModelCount int64 `json:"resource_model_count,omitempty"`
11-
ResourceExperimentCount int64 `json:"resource_experiment_count,omitempty"`
12-
ResourceModelServingEndpointCount int64 `json:"resource_model_serving_endpoint_count,omitempty"`
13-
ResourceRegisteredModelCount int64 `json:"resource_registered_model_count,omitempty"`
14-
ResourceQualityMonitorCount int64 `json:"resource_quality_monitor_count,omitempty"`
15-
ResourceSchemaCount int64 `json:"resource_schema_count,omitempty"`
16-
ResourceVolumeCount int64 `json:"resource_volume_count,omitempty"`
17-
ResourceClusterCount int64 `json:"resource_cluster_count,omitempty"`
18-
ResourceDashboardCount int64 `json:"resource_dashboard_count,omitempty"`
19-
ResourceAppCount int64 `json:"resource_app_count,omitempty"`
7+
ResourceCount int64 `json:"resource_count"`
8+
ResourceJobCount int64 `json:"resource_job_count"`
9+
ResourcePipelineCount int64 `json:"resource_pipeline_count"`
10+
ResourceModelCount int64 `json:"resource_model_count"`
11+
ResourceExperimentCount int64 `json:"resource_experiment_count"`
12+
ResourceModelServingEndpointCount int64 `json:"resource_model_serving_endpoint_count"`
13+
ResourceRegisteredModelCount int64 `json:"resource_registered_model_count"`
14+
ResourceQualityMonitorCount int64 `json:"resource_quality_monitor_count"`
15+
ResourceSchemaCount int64 `json:"resource_schema_count"`
16+
ResourceVolumeCount int64 `json:"resource_volume_count"`
17+
ResourceClusterCount int64 `json:"resource_cluster_count"`
18+
ResourceDashboardCount int64 `json:"resource_dashboard_count"`
19+
ResourceAppCount int64 `json:"resource_app_count"`
2020

2121
// IDs of resources managed by the bundle. Some resources like volumes or schemas
2222
// do not expose a numerical or UUID identifier and are tracked by name. Those
@@ -34,18 +34,18 @@ type BundleDeployEvent struct {
3434
// any notice.
3535
type BundleDeployExperimental struct {
3636
// Number of configuration files in the bundle.
37-
ConfigurationFileCount int64 `json:"configuration_file_count,omitempty"`
37+
ConfigurationFileCount int64 `json:"configuration_file_count"`
3838

3939
// Size in bytes of the Terraform state file
4040
TerraformStateSizeBytes int64 `json:"terraform_state_size_bytes,omitempty"`
4141

4242
// Number of variables in the bundle
43-
VariableCount int64 `json:"variable_count,omitempty"`
44-
ComplexVariableCount int64 `json:"complex_variable_count,omitempty"`
45-
LookupVariableCount int64 `json:"lookup_variable_count,omitempty"`
43+
VariableCount int64 `json:"variable_count"`
44+
ComplexVariableCount int64 `json:"complex_variable_count"`
45+
LookupVariableCount int64 `json:"lookup_variable_count"`
4646

4747
// Number of targets in the bundle
48-
TargetCount int64 `json:"target_count,omitempty"`
48+
TargetCount int64 `json:"target_count"`
4949

5050
// Whether a field is set or not. If a configuration field is not present in this
5151
// map then it is not tracked by this field.

0 commit comments

Comments
 (0)