|
633 | 633 | import datadog.environment.EnvironmentVariables;
|
634 | 634 | import datadog.environment.JavaVirtualMachine;
|
635 | 635 | import datadog.environment.OperatingSystem;
|
| 636 | +import datadog.environment.SystemProperties; |
636 | 637 | import datadog.trace.api.civisibility.CiVisibilityWellKnownTags;
|
637 | 638 | import datadog.trace.api.config.GeneralConfig;
|
638 | 639 | import datadog.trace.api.config.ProfilingConfig;
|
@@ -1237,7 +1238,7 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins
|
1237 | 1238 | configFileStatus = configProvider.getConfigFileStatus();
|
1238 | 1239 | runtimeIdEnabled =
|
1239 | 1240 | configProvider.getBoolean(RUNTIME_ID_ENABLED, true, RUNTIME_METRICS_RUNTIME_ID_ENABLED);
|
1240 |
| - runtimeVersion = System.getProperty("java.version", "unknown"); |
| 1241 | + runtimeVersion = SystemProperties.getOrDefault("java.version", "unknown"); |
1241 | 1242 |
|
1242 | 1243 | // Note: We do not want APiKey to be loaded from property for security reasons
|
1243 | 1244 | // Note: we do not use defined default here
|
@@ -3398,7 +3399,7 @@ public static boolean isDatadogProfilerSafeInCurrentEnvironment() {
|
3398 | 3399 | // don't want to put this logic (which will evolve) in the public ProfilingConfig, and can't
|
3399 | 3400 | // access Platform there
|
3400 | 3401 | if (!JavaVirtualMachine.isJ9() && isJavaVersion(8)) {
|
3401 |
| - String arch = System.getProperty("os.arch"); |
| 3402 | + String arch = SystemProperties.get("os.arch"); |
3402 | 3403 | if ("aarch64".equalsIgnoreCase(arch) || "arm64".equalsIgnoreCase(arch)) {
|
3403 | 3404 | return false;
|
3404 | 3405 | }
|
@@ -4442,12 +4443,12 @@ public CiVisibilityWellKnownTags getCiVisibilityWellKnownTags() {
|
4442 | 4443 | getRuntimeId(),
|
4443 | 4444 | getEnv(),
|
4444 | 4445 | LANGUAGE_TAG_VALUE,
|
4445 |
| - System.getProperty("java.runtime.name"), |
4446 |
| - System.getProperty("java.version"), |
4447 |
| - System.getProperty("java.vendor"), |
4448 |
| - System.getProperty("os.arch"), |
4449 |
| - System.getProperty("os.name"), |
4450 |
| - System.getProperty("os.version"), |
| 4446 | + SystemProperties.get("java.runtime.name"), |
| 4447 | + SystemProperties.get("java.version"), |
| 4448 | + SystemProperties.get("java.vendor"), |
| 4449 | + SystemProperties.get("os.arch"), |
| 4450 | + SystemProperties.get("os.name"), |
| 4451 | + SystemProperties.get("os.version"), |
4451 | 4452 | isServiceNameSetByUser() ? "true" : "false");
|
4452 | 4453 | }
|
4453 | 4454 |
|
@@ -5209,7 +5210,7 @@ private static String getProp(String name) {
|
5209 | 5210 | }
|
5210 | 5211 |
|
5211 | 5212 | private static String getProp(String name, String def) {
|
5212 |
| - String value = System.getProperty(name, def); |
| 5213 | + String value = SystemProperties.getOrDefault(name, def); |
5213 | 5214 | if (value != null) {
|
5214 | 5215 | ConfigCollector.get().put(name, value, ConfigOrigin.JVM_PROP);
|
5215 | 5216 | }
|
|
0 commit comments