static

in aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/AWSXRayRecorder.java [84:117]


    static {
        Map<String, Object> sdkVersioninformation = new HashMap<>();
        Map<String, Object> runtimeInformation = new HashMap<>();

        Properties properties = new Properties();
        InputStream propertiesStream = AWSXRayRecorder.class.getResourceAsStream(PROPERTIES_LOCATION);
        if (propertiesStream != null) {
            try {
                properties.load(propertiesStream);
            } catch (IOException | IllegalArgumentException e) {
                logger.warn("Unable to detect SDK version.", e);
            }
        } else {
            logger.warn("SDK properties file not found.");
        }

        sdkVersioninformation.put("sdk", SDK);
        String sdkVersion = properties.getProperty(SDK_VERSION_KEY, DEFAULT_SDK_VERSION);
        sdkVersioninformation.put("sdk_version", sdkVersion);


        String javaVersion = System.getProperty("java.version");
        if (javaVersion != null) {
            runtimeInformation.put("runtime_version", javaVersion);
        }

        String javaVmName = System.getProperty("java.vm.name");
        if (javaVmName != null) {
            runtimeInformation.put("runtime", javaVmName);
        }

        SDK_VERSION_INFORMATION = Collections.unmodifiableMap(sdkVersioninformation);
        RUNTIME_INFORMATION = Collections.unmodifiableMap(runtimeInformation);
    }