private String getActiveProfile(Properties defaultProperties) {
        String profile = getProfileProperties(defaultProperties, ProfileConstants.ACTIVE_PROFILE_KEY);
        if (profile == null) {
            throw new RuntimeException("Failed to detect pinpoint profile. Please add -D" +
                    ProfileConstants.ACTIVE_PROFILE_KEY +
                    "=<profile> to VM option. Valid profiles are \"" + supportedProfiles + "\"");
        }

        // prevent directory traversal attack
        for (Path supportedProfile : supportedProfiles) {
            if (supportedProfile.toString().equalsIgnoreCase(profile)) {
                return supportedProfile.toString();
            }
        }

        // handle alias
        for (Path supportedProfile : supportedProfiles) {
            String supportedProfileName = supportedProfile.toString();
            String aliasesStr = getProfileProperties(defaultProperties, ProfileConstants.PROFILE_ALIAS_KEY_PREFIX + supportedProfileName);
            if (containsAlias(aliasesStr, profile)) {
                logger.info(String.format("resolved profile alias '%s' to supported profile '%s'", profile, supportedProfileName));
                return supportedProfileName;
            }
        }
        throw new IllegalStateException("unsupported profile:" + profile);
    }
<pre>Configuration order</pre>

<p> Same order as Spring-Boot </p>
<p>
    <a href="https://docs.spring.io/spring-boot/docs/2.1.9.RELEASE/reference/html/boot-features-external-config.html">
        boot-features-external-config
    </a>
</p>
<ol>
    <li>Java System properties</li>
    <li>OS environment variables</li>
    <li>agent external configuration</li>
    <li>agent profile configuration /profiles/${profile}/pinpoint.config</li>
    <li>agent config /pinpoint-env.config</li>
</ol>
agent-module/bootstraps/bootstrap/src/main/java/com/navercorp/pinpoint/bootstrap/config/ProfilePropertyLoader.java