Skip to content

Commit bfefa91

Browse files
authored
[PECOBLR-1302]add telemetry for metric view (#1115)
## Description Add metric view param to telemetry ## Testing <!-- Describe how the changes have been tested--> Unit test ## Additional Notes to the Reviewer <!-- Share any additional context or insights that may help the reviewer understand the changes better. This could include challenges faced, limitations, or compromises made during the development process. Also, mention any areas of the code that you would like the reviewer to focus on specifically. --> NO_CHANGELOG=true
1 parent 94fb238 commit bfefa91

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/main/java/com/databricks/jdbc/model/telemetry/DriverConnectionParameters.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ public class DriverConnectionParameters {
136136
@JsonProperty("async_poll_interval_millis")
137137
int asyncPollIntervalMillis;
138138

139+
@JsonProperty("enable_metric_view_metadata")
140+
boolean enableMetricViewMetadata;
141+
139142
public DriverConnectionParameters setHttpPath(String httpPath) {
140143
this.httpPath = httpPath;
141144
return this;
@@ -356,6 +359,11 @@ public DriverConnectionParameters setAsyncPollIntervalMillis(int asyncPollInterv
356359
return this;
357360
}
358361

362+
public DriverConnectionParameters setEnableMetricViewMetadata(boolean enableMetricViewMetadata) {
363+
this.enableMetricViewMetadata = enableMetricViewMetadata;
364+
return this;
365+
}
366+
359367
@Override
360368
public String toString() {
361369
return new ToStringer(DriverConnectionParameters.class)
@@ -402,6 +410,7 @@ public String toString() {
402410
.add("useSystemTrustStore", useSystemTrustStore)
403411
.add("rowsFetchedPerBlock", rowsFetchedPerBlock)
404412
.add("asyncPollIntervalMillis", asyncPollIntervalMillis)
413+
.add("enableMetricViewMetadata", enableMetricViewMetadata)
405414
.toString();
406415
}
407416
}

src/main/java/com/databricks/jdbc/telemetry/TelemetryHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ private static DriverConnectionParameters buildDriverConnectionParameters(
222222
.setRowsFetchedPerBlock(connectionContext.getRowsFetchedPerBlock())
223223
.setAsyncPollIntervalMillis(connectionContext.getAsyncExecPollInterval())
224224
.setEnableTokenCache(connectionContext.isTokenCacheEnabled())
225-
.setHttpPath(connectionContext.getHttpPath());
225+
.setHttpPath(connectionContext.getHttpPath())
226+
.setEnableMetricViewMetadata(connectionContext.getEnableMetricViewMetadata());
226227
} catch (DatabricksValidationException e) {
227228
// If configuration validation fails, return null to skip telemetry export
228229
// This prevents invalid configuration from breaking telemetry

0 commit comments

Comments
 (0)