final String host = DeploymentDefinition.VIRTUAL_HOST.resolveModelAttribute(context, subModel).asString();
final String path = DeploymentDefinition.CONTEXT_ROOT.resolveModelAttribute(context, subModel).asString();
final String server = DeploymentDefinition.SERVER.resolveModelAttribute(context, subModel).asString();
final ServiceController<?> controller = context.getServiceRegistry(false).getService(UndertowService.deploymentServiceName(server, host, path));
final UndertowDeploymentService deploymentService = (UndertowDeploymentService) controller.getService();
final DeploymentInfo deploymentInfo = deploymentService.getDeploymentInfoInjectedValue().getValue();
final UndertowMetricsCollector collector = (UndertowMetricsCollector)deploymentInfo.getMetricsCollector();
context.addStep(new OperationStepHandler() {
@Override
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException {