Skip to content

Commit

Permalink
SNOW-1278872 Added jdk version and vendor to metrics (#972)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-mjedig authored Oct 24, 2024
1 parent 020970f commit 7bf07f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public abstract class SnowflakeTelemetryService {
private static final String KAFKA_VERSION = "kafka_version";
protected static final String IS_PIPE_CLOSING = "is_pipe_closing";
protected static final String IS_CHANNEL_CLOSING = "is_channel_closing";
public static final String JDK_VERSION = "jdk_version";
public static final String JDK_DISTRIBUTION = "jdk_distribution";

// Telemetry instance fetched from JDBC
protected Telemetry telemetry;
Expand Down Expand Up @@ -77,8 +79,13 @@ public void reportKafkaConnectStart(
final long startTime, final Map<String, String> userProvidedConfig) {
ObjectNode dataObjectNode = getObjectNode();

String jdkVersion = System.getProperty("java.version");
String jdkDistribution = System.getProperty("java.vendor");

dataObjectNode.put(START_TIME, startTime);
dataObjectNode.put(KAFKA_VERSION, AppInfoParser.getVersion());
dataObjectNode.put(JDK_VERSION, jdkVersion);
dataObjectNode.put(JDK_DISTRIBUTION, jdkDistribution);
addUserConnectorPropertiesToDataNode(userProvidedConfig, dataObjectNode);

send(SnowflakeTelemetryService.TelemetryType.KAFKA_START, dataObjectNode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ public void testReportKafkaConnectStart(IngestionMethodConfig ingestionMethodCon
dataNode.get(TelemetryConstants.START_TIME).asLong() <= System.currentTimeMillis()
&& dataNode.get(TelemetryConstants.START_TIME).asLong() >= this.startTime);

assertNotNull(dataNode.get("jdk_version"));
assertNotNull(dataNode.get("jdk_distribution"));

validateBufferProperties(dataNode);
validateKeyAndValueConverter(dataNode);
}
Expand Down

0 comments on commit 7bf07f0

Please sign in to comment.