Skip to content

Commit

Permalink
update profiling server url for v2 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
arjun-mw authored Jun 24, 2024
1 parent 657b853 commit a8f1e8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class EnvironmentConfig {

public static final String MW_PROFILING_SERVER_URL =
System.getenv().getOrDefault("MW_PROFILING_SERVER_URL", "https://profiling.middleware.io");
System.getenv().get("MW_PROFILING_SERVER_URL");

public static final String MW_PROFILING_ALLOC =
System.getenv().getOrDefault("MW_PROFILING_ALLOC", "512k");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ public static void startProfiling() {
try {
String tenantId = authenticateAndGetTenantId();
if (tenantId != null) {
String profilingServerUrl = EnvironmentConfig.MW_PROFILING_SERVER_URL;
if (profilingServerUrl == null) {
profilingServerUrl = "https://" + tenantId + ".middleware.io/profiling";
}
PyroscopeAgent.start(
new Config.Builder()
.setApplicationName(SystemProperties.SERVICE_NAME)
.setProfilingEvent(EventType.ITIMER)
.setProfilingAlloc(EnvironmentConfig.MW_PROFILING_ALLOC)
.setProfilingLock(EnvironmentConfig.MW_PROFILING_LOCK)
.setServerAddress(EnvironmentConfig.MW_PROFILING_SERVER_URL)
.setServerAddress(profilingServerUrl)
.setTenantID(tenantId)
.build());
} else {
Expand Down

0 comments on commit a8f1e8e

Please sign in to comment.