Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1278872 Added jdk version and vendor to metrics #972

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
sfc-gh-mbobowski marked this conversation as resolved.
Show resolved Hide resolved
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
Loading