content: /*
   * Copyright The OpenTelemetry Authors
   * SPDX-License-Identifier: Apache-2.0
   */
  
  package io.opentelemetry.instrumentation.spring.autoconfigure.internal.instrumentation.micrometer;
  
  import io.micrometer.core.instrument.Clock;
  import io.micrometer.core.instrument.MeterRegistry;
  import io.opentelemetry.api.OpenTelemetry;
  import io.opentelemetry.instrumentation.micrometer.v1_5.OpenTelemetryMeterRegistry;
  import io.opentelemetry.instrumentation.spring.autoconfigure.internal.ConditionalOnEnabledInstrumentation;
  import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration;
  import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
  import org.springframework.boot.autoconfigure.AutoConfigureAfter;
  import org.springframework.boot.autoconfigure.AutoConfigureBefore;
  import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
  import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  
  /**
   * This class is internal and is hence not for public use. Its APIs are unstable and can change at
   * any time.
   */
  @ConditionalOnEnabledInstrumentation(module = "micrometer", enabledByDefault = false)
  @AutoConfigureAfter(MetricsAutoConfiguration.class)
  @AutoConfigureBefore(CompositeMeterRegistryAutoConfiguration.class)
  @ConditionalOnBean(Clock.class)
  @ConditionalOnClass(MeterRegistry.class)
  @Configuration
  public class MicrometerBridgeAutoConfiguration {
  
    @Bean
    MeterRegistry otelMeterRegistry(OpenTelemetry openTelemetry, Clock micrometerClock) {
      return OpenTelemetryMeterRegistry.builder(openTelemetry).setClock(micrometerClock).build();
    }
  }
  