|
23 | 23 | @Slf4j |
24 | 24 | public class HarnessConnector implements Connector, AutoCloseable { |
25 | 25 | public static final String REQUEST_ID_KEY = "requestId"; |
| 26 | + private static final String HARNESS_SDK_INFO = |
| 27 | + String.format("Java %s Server", io.harness.cf.Version.VERSION); |
26 | 28 | private final ClientApi api; |
27 | 29 | private final MetricsApi metricsApi; |
28 | 30 | private final String apiKey; |
@@ -66,6 +68,7 @@ ApiClient makeApiClient(int retryBackOfDelay) { |
66 | 68 | apiClient.setWriteTimeout(options.getWriteTimeout()); |
67 | 69 | apiClient.setDebugging(log.isDebugEnabled()); |
68 | 70 | apiClient.setUserAgent("JavaSDK " + io.harness.cf.Version.VERSION); |
| 71 | + apiClient.addDefaultHeader("Harness-SDK-Info", HARNESS_SDK_INFO); |
69 | 72 |
|
70 | 73 | setupTls(apiClient); |
71 | 74 |
|
@@ -104,6 +107,7 @@ ApiClient makeMetricsApiClient(int retryBackoffDelay) { |
104 | 107 | apiClient.setWriteTimeout(maxTimeout); |
105 | 108 | apiClient.setDebugging(log.isDebugEnabled()); |
106 | 109 | apiClient.setUserAgent("JavaSDK " + io.harness.cf.Version.VERSION); |
| 110 | + apiClient.addDefaultHeader("Harness-SDK-Info", HARNESS_SDK_INFO); |
107 | 111 |
|
108 | 112 | setupTls(apiClient); |
109 | 113 |
|
@@ -337,6 +341,7 @@ public Service stream(@NonNull final Updater updater) throws ConnectorException |
337 | 341 | final Map<String, String> map = new HashMap<>(); |
338 | 342 | map.put("Authorization", "Bearer " + token); |
339 | 343 | map.put("API-Key", apiKey); |
| 344 | + map.put("Harness-SDK-Info", HARNESS_SDK_INFO); |
340 | 345 | log.info("Initialize new EventSource instance"); |
341 | 346 | eventSource = |
342 | 347 | new EventSource( |
|
0 commit comments