Skip to content

Commit 5bedea6

Browse files
author
Mohamed Bilal
committed
Updated telemetry header to include java runtime version
1 parent 2a30957 commit 5bedea6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/microsoft/graph/httpcore/TelemetryHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class TelemetryHandler implements Interceptor{
1313
public static final String SDK_VERSION = "SdkVersion";
1414
public static final String VERSION = "v1.0.0";
1515
public static final String GRAPH_VERSION_PREFIX = "graph-java-core";
16+
public static final String JAVA_VERSION_PREFIX = "java";
1617
public static final String CLIENT_REQUEST_ID = "client-request-id";
1718

1819
@Override
@@ -25,7 +26,8 @@ public Response intercept(Chain chain) throws IOException {
2526
telemetryOptions = new TelemetryOptions();
2627

2728
String featureUsage = "(featureUsage=" + telemetryOptions.getFeatureUsage() + ")";
28-
String sdkversion_value = GRAPH_VERSION_PREFIX + "/" + VERSION + " " + featureUsage;
29+
String javaVersion = System.getProperty("java.version");
30+
String sdkversion_value = GRAPH_VERSION_PREFIX + "/" + VERSION + " " + featureUsage + " " + JAVA_VERSION_PREFIX + "/" + javaVersion;
2931
telemetryAddedBuilder.addHeader(SDK_VERSION, sdkversion_value);
3032

3133
if(request.header(CLIENT_REQUEST_ID) == null) {

0 commit comments

Comments
 (0)