File tree 2 files changed +6
-2
lines changed
examples/extension/src/main/java/com/example
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 9
9
public class EnvironmentConfig {
10
10
11
11
public static final String MW_PROFILING_SERVER_URL =
12
- System .getenv ().getOrDefault ("MW_PROFILING_SERVER_URL" , "https://profiling.middleware.io " );
12
+ System .getenv ().get ("MW_PROFILING_SERVER_URL" );
13
13
14
14
public static final String MW_PROFILING_ALLOC =
15
15
System .getenv ().getOrDefault ("MW_PROFILING_ALLOC" , "512k" );
Original file line number Diff line number Diff line change @@ -33,13 +33,17 @@ public static void startProfiling() {
33
33
try {
34
34
String tenantId = authenticateAndGetTenantId ();
35
35
if (tenantId != null ) {
36
+ String profilingServerUrl = EnvironmentConfig .MW_PROFILING_SERVER_URL ;
37
+ if (profilingServerUrl == null ) {
38
+ profilingServerUrl = "https://" + tenantId + ".middleware.io/profiling" ;
39
+ }
36
40
PyroscopeAgent .start (
37
41
new Config .Builder ()
38
42
.setApplicationName (SystemProperties .SERVICE_NAME )
39
43
.setProfilingEvent (EventType .ITIMER )
40
44
.setProfilingAlloc (EnvironmentConfig .MW_PROFILING_ALLOC )
41
45
.setProfilingLock (EnvironmentConfig .MW_PROFILING_LOCK )
42
- .setServerAddress (EnvironmentConfig . MW_PROFILING_SERVER_URL )
46
+ .setServerAddress (profilingServerUrl )
43
47
.setTenantID (tenantId )
44
48
.build ());
45
49
} else {
You can’t perform that action at this time.
0 commit comments