/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */
apply plugin: 'elasticsearch.internal-es-plugin'
apply plugin: 'elasticsearch.internal-java-rest-test'

esplugin {
  name = 'apm'
  description = 'Provides APM integration for Elasticsearch'
  classname ='org.elasticsearch.telemetry.apm.APM'
}

def otelVersion = '1.31.0'
def otelSemconvVersion = '1.21.0-alpha'

dependencies {
  implementation "io.opentelemetry:opentelemetry-api:${otelVersion}"
  implementation "io.opentelemetry:opentelemetry-context:${otelVersion}"
  implementation "io.opentelemetry:opentelemetry-semconv:${otelSemconvVersion}"
  runtimeOnly    "co.elastic.apm:elastic-apm-agent:1.52.2"

  javaRestTestImplementation project(':modules:apm')
  javaRestTestImplementation project(':test:framework')
}

tasks.named("dependencyLicenses").configure {
  mapping from: /opentelemetry-.*/, to: 'opentelemetry'
}
