Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Spring Boot service name guesser / ResourceProvider #6516

Merged
merged 11 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ dependencies {
implementation("org.springframework.boot:spring-boot-autoconfigure:$springBootVersion")
annotationProcessor("org.springframework.boot:spring-boot-autoconfigure-processor:$springBootVersion")
implementation("javax.validation:validation-api:2.0.1.Final")
annotationProcessor("com.google.auto.service:auto-service")
compileOnly("com.google.auto.service:auto-service-annotations")
testCompileOnly("com.google.auto.service:auto-service-annotations")

implementation(project(":instrumentation-annotations-support"))
implementation(project(":instrumentation:kafka:kafka-clients:kafka-clients-2.6:library"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
id("otel.library-instrumentation")
mateuszrzeszutek marked this conversation as resolved.
Show resolved Hide resolved
}

dependencies {
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi")
annotationProcessor("com.google.auto.service:auto-service")
compileOnly("com.google.auto.service:auto-service-annotations")
implementation("org.yaml:snakeyaml:1.31")
testCompileOnly("com.google.auto.service:auto-service-annotations")
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi")
breedx-splk marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@

import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.resources.Resource;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URL;
import java.nio.file.Files;
Expand Down Expand Up @@ -127,15 +124,7 @@ private static void writeString(Path path, String value) throws Exception {
}

private static String readString(Path path) throws Exception {
StringBuilder buff = new StringBuilder();
try (InputStream in = Files.newInputStream(path)) {
BufferedReader reader = new BufferedReader(new InputStreamReader(in, UTF_8));
char[] block = new char[1024];
int rc;
while ((rc = reader.read(block)) > 0) {
buff.append(block, 0, rc);
}
return buff.toString();
}
byte[] allBytes = Files.readAllBytes(path);
return new String(allBytes, UTF_8);
}
}
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ include(":instrumentation:servlet:servlet-5.0:javaagent")
include(":instrumentation:spark-2.3:javaagent")
include(":instrumentation:spring:spring-batch-3.0:javaagent")
include(":instrumentation:spring:spring-boot-actuator-autoconfigure-2.0:javaagent")
include(":instrumentation:spring:spring-boot-resources:library")
include(":instrumentation:spring:spring-core-2.0:javaagent")
include(":instrumentation:spring:spring-data-1.8:javaagent")
include(":instrumentation:spring:spring-integration-4.1:javaagent")
Expand Down