| 1 | /* |
| 2 | * Copyright (c) 2022 Microsoft Corporation |
| 3 | * |
| 4 | * This program and the accompanying materials are made available under the |
| 5 | * terms of the Apache License, Version 2.0 which is available at |
| 6 | * https://www.apache.org/licenses/LICENSE-2.0 |
| 7 | * |
| 8 | * SPDX-License-Identifier: Apache-2.0 |
| 9 | * |
| 10 | * Contributors: |
| 11 | * Microsoft Corporation - initial API and implementation |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | plugins { |
| 16 | `java-library` |
| 17 | `maven-publish` |
| 18 | } |
| 19 | |
| 20 | dependencies { |
| 21 | api(project(":spi:common:core-spi")) |
| 22 | api(libs.micrometer) |
| 23 | api(libs.okhttp) |
| 24 | } |
| 25 | |
| 26 | tasks.withType<Test> { |
| 27 | val agent = rootDir.resolve("opentelemetry-javaagent.jar") |
| 28 | if (agent.exists()) { |
| 29 | jvmArgs( |
| 30 | "-javaagent:${agent.absolutePath}", |
| 31 | // Exposes metrics at http://localhost:9464/metrics |
| 32 | "-Dotel.metrics.exporter=prometheus" |
| 33 | ) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | |