content: /*
   * Copyright The OpenTelemetry Authors
   * SPDX-License-Identifier: Apache-2.0
   */
  
  package io.opentelemetry.javaagent.instrumentation.kotlinxcoroutines;
  
  import static java.util.Arrays.asList;
  
  import com.google.auto.service.AutoService;
  import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
  import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
  import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
  import java.util.List;
  
  @AutoService(InstrumentationModule.class)
  public class KotlinCoroutinesInstrumentationModule extends InstrumentationModule
      implements ExperimentalInstrumentationModule {
  
    public KotlinCoroutinesInstrumentationModule() {
      super("kotlinx-coroutines", "kotlinx-coroutines-1.0");
    }
  
    @Override
    public boolean isHelperClass(String className) {
      return className.startsWith("io.opentelemetry.extension.kotlin.");
    }
  
    @Override
    public String getModuleGroup() {
      // This module uses the api context bridge helpers, therefore must be in the same classloader
      return "opentelemetry-api-bridge";
    }
  
    @Override
    public List<TypeInstrumentation> typeInstrumentations() {
      return asList(
          new KotlinCoroutinesInstrumentation(), new KotlinCoroutineDispatcherInstrumentation());
    }
  }
  