public static ObservableMetricsSystem create(final MetricsConfiguration metricsConfiguration) {
    LOG.trace("Creating a metric system with {}", metricsConfiguration.getProtocol());
    if (!metricsConfiguration.isEnabled() && !metricsConfiguration.isPushEnabled()) {
      disableGlobalOpenTelemetry();
      return new NoOpMetricsSystem();
    }
    if (PROMETHEUS.equals(metricsConfiguration.getProtocol())) {
      final PrometheusMetricsSystem metricsSystem =
          new PrometheusMetricsSystem(
              metricsConfiguration.getMetricCategories(), metricsConfiguration.isTimersEnabled());
      metricsSystem.init();
      disableGlobalOpenTelemetry();
      return metricsSystem;
    } else if (OPENTELEMETRY.equals(metricsConfiguration.getProtocol())) {
      final OpenTelemetrySystem metricsSystem =
          new OpenTelemetrySystem(
              metricsConfiguration.getMetricCategories(),
              metricsConfiguration.isTimersEnabled(),
              metricsConfiguration.getPrometheusJob(),
              true);
      metricsSystem.initDefaults();
      return metricsSystem;
    } else {
      throw new IllegalArgumentException(
          "Invalid metrics protocol " + metricsConfiguration.getProtocol());
    }
  }
Creates and starts a new metric system to observe the behavior of the client

@param metricsConfiguration the configuration of the metric system
@return a new metric system
metrics/core/src/main/java/org/hyperledger/besu/metrics/MetricsSystemFactory.java