Search in sources :

Example 1 with OpenTelemetryDependencyProcessor

use of org.wildfly.extension.opentelemetry.deployment.OpenTelemetryDependencyProcessor in project wildfly by wildfly.

the class OpenTelemetrySubsystemAdd method performBoottime.

/**
 * {@inheritDoc}
 */
@Override
protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
    super.performBoottime(context, operation, model);
    final OpenTelemetryConfig config = OpenTelemetryConfigBuilder.config().withServiceName(OpenTelemetrySubsystemDefinition.SERVICE_NAME.resolveModelAttribute(context, model).asStringOrNull()).withExporter(OpenTelemetrySubsystemDefinition.EXPORTER.resolveModelAttribute(context, model).asString()).withEndpoint(OpenTelemetrySubsystemDefinition.ENDPOINT.resolveModelAttribute(context, model).asStringOrNull()).withSpanProcessor(OpenTelemetrySubsystemDefinition.SPAN_PROCESSOR_TYPE.resolveModelAttribute(context, model).asString()).withBatchDelay(OpenTelemetrySubsystemDefinition.BATCH_DELAY.resolveModelAttribute(context, model).asLong()).withMaxQueueSize(OpenTelemetrySubsystemDefinition.MAX_QUEUE_SIZE.resolveModelAttribute(context, model).asInt()).withMaxExportBatchSize(OpenTelemetrySubsystemDefinition.MAX_EXPORT_BATCH_SIZE.resolveModelAttribute(context, model).asInt()).withExportTimeout(OpenTelemetrySubsystemDefinition.EXPORT_TIMEOUT.resolveModelAttribute(context, model).asLong()).withSampler(OpenTelemetrySubsystemDefinition.SAMPLER.resolveModelAttribute(context, model).asStringOrNull()).withRatio(OpenTelemetrySubsystemDefinition.RATIO.resolveModelAttribute(context, model).asDoubleOrNull()).build();
    final OpenTelemetryHolder holder = new OpenTelemetryHolder(config);
    context.addStep(new AbstractDeploymentChainStep() {

        @Override
        public void execute(DeploymentProcessorTarget processorTarget) {
            processorTarget.addDeploymentProcessor(OpenTelemetrySubsystemExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, 0x1910, new OpenTelemetryDependencyProcessor());
            processorTarget.addDeploymentProcessor(OpenTelemetrySubsystemExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, 0x3810, new OpenTelemetrySubsystemDeploymentProcessor(holder));
        }
    }, OperationContext.Stage.RUNTIME);
}
Also used : OpenTelemetrySubsystemDeploymentProcessor(org.wildfly.extension.opentelemetry.deployment.OpenTelemetrySubsystemDeploymentProcessor) DeploymentProcessorTarget(org.jboss.as.server.DeploymentProcessorTarget) AbstractDeploymentChainStep(org.jboss.as.server.AbstractDeploymentChainStep) OpenTelemetryDependencyProcessor(org.wildfly.extension.opentelemetry.deployment.OpenTelemetryDependencyProcessor)

Aggregations

AbstractDeploymentChainStep (org.jboss.as.server.AbstractDeploymentChainStep)1 DeploymentProcessorTarget (org.jboss.as.server.DeploymentProcessorTarget)1 OpenTelemetryDependencyProcessor (org.wildfly.extension.opentelemetry.deployment.OpenTelemetryDependencyProcessor)1 OpenTelemetrySubsystemDeploymentProcessor (org.wildfly.extension.opentelemetry.deployment.OpenTelemetrySubsystemDeploymentProcessor)1