Search in sources :

Example 1 with JaegerFraction

use of org.wildfly.swarm.jaeger.JaegerFraction in project wildfly-swarm by wildfly-swarm.

the class JaegerInstaller method process.

@Override
public void process() throws Exception {
    JaegerFraction fraction = jaegerFractionInstance.get();
    logger.info("Determining whether to install Jaeger integration or not.");
    logger.info("JaegerFraction instance: " + fraction);
    if (archive.getName().endsWith(".war")) {
        logger.logf(Logger.Level.INFO, "Installing the Jaeger integration for the deployment %s", archive.getName());
        WARArchive webArchive = archive.as(WARArchive.class);
        WebXmlAsset webXml = webArchive.findWebXmlAsset();
        logger.logf(Logger.Level.INFO, "Adding the listener org.wildfly.swarm.jaeger.deployment.JaegerInitializer");
        webXml.addListener("org.wildfly.swarm.jaeger.deployment.JaegerInitializer");
        setContextParamIfNotNull(webXml, JAEGER_SERVICE_NAME, fraction.getServiceName());
        setContextParamIfNotNull(webXml, JAEGER_SERVICE_NAME, fraction.getServiceName());
        setContextParamIfNotNull(webXml, JAEGER_SAMPLER_TYPE, fraction.getSamplerType());
        setContextParamIfNotNull(webXml, JAEGER_SAMPLER_PARAM, fraction.getSamplerParameter());
        setContextParamIfNotNull(webXml, JAEGER_SAMPLER_MANAGER_HOST_PORT, fraction.getSamplerManagerHost());
        setContextParamIfNotNull(webXml, JAEGER_REPORTER_LOG_SPANS, fraction.getReporterLogSpans());
        setContextParamIfNotNull(webXml, JAEGER_AGENT_HOST, fraction.getAgentHost());
        setContextParamIfNotNull(webXml, JAEGER_AGENT_PORT, fraction.getAgentPort());
        setContextParamIfNotNull(webXml, JAEGER_REPORTER_FLUSH_INTERVAL, fraction.getReporterFlushInterval());
        setContextParamIfNotNull(webXml, JAEGER_REPORTER_MAX_QUEUE_SIZE, fraction.getReporterMaxQueueSize());
        webXml.setContextParam("skipOpenTracingResolver", "true");
    }
}
Also used : WebXmlAsset(org.wildfly.swarm.undertow.descriptors.WebXmlAsset) WARArchive(org.wildfly.swarm.undertow.WARArchive) JaegerFraction(org.wildfly.swarm.jaeger.JaegerFraction)

Aggregations

JaegerFraction (org.wildfly.swarm.jaeger.JaegerFraction)1 WARArchive (org.wildfly.swarm.undertow.WARArchive)1 WebXmlAsset (org.wildfly.swarm.undertow.descriptors.WebXmlAsset)1