@Override
    public ApplicationEntrypointInitializer initialize(final String[] mainArguments) {
        val apmEnabled = StringUtils.defaultIfBlank(System.getProperty(SETTING_ELASTIC_APM_AGENT_ENABLED,
            System.getenv(SETTING_ELASTIC_APM_AGENT_ENABLED)), "true");
        if (BooleanUtils.toBoolean(apmEnabled)) {
            //CHECKSTYLE:OFF
            System.out.println("Attaching Elastic APM Agent...");
            //CHECKSTYLE:ON
            ElasticApmAttacher.attach();
        }
        return this;
    }
This is {@link ElasticApmAgentInitializer}.
This callback runs prior to the initialization of the application context
just as CAS is about to start up.
@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-elastic/src/main/java/org/apereo/cas/apm/ElasticApmAgentInitializer.java