/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

apply plugin: 'java-library'

description = 'Open Telemetry (OTEL) tracer'

dependencies {
  implementation platform(project(':platform'))
  implementation project(':solr:core')
  implementation project(':solr:solrj')

  implementation platform(libs.netty.bom)
  implementation platform(libs.opentelemetry.bom)

  implementation libs.slf4j.api

  implementation libs.opentelemetry.api
  implementation libs.opentelemetry.sdkextension.autoconfigure
  runtimeOnly libs.opentelemetry.exporter.otlp
  // End users must recompile with jaeger exporter and/or zipkin exporter if they need these

  // NOTE: sdk-autoconfigure needs both opentelemetry-sdk-metrics and opentelemetry-sdk-logs even if we don't use them

  // gRPC transport via netty - since we already ship netty this is more lightweight than netty-shaded
  runtimeOnly libs.grpc.netty
  runtimeOnly libs.grpc.protobuf
  runtimeOnly libs.grpc.stub
  runtimeOnly libs.grpc.context
  // See https://issues.apache.org/jira/browse/LOG4J2-3609 due to needing these annotations
  compileOnly libs.apache.tomcat.annotationsapi

  testImplementation project(':solr:test-framework')
  testImplementation libs.junit.junit
  testImplementation libs.opentelemetry.sdk
  testImplementation libs.opentelemetry.sdktrace
  testImplementation libs.opentelemetry.sdktesting
}
