Skip to content

Commit 26e6903

Browse files
committed
ignore common modules
1 parent ece7336 commit 26e6903

File tree

5 files changed

+12
-18
lines changed

5 files changed

+12
-18
lines changed

docs/instrumentation-list.yaml

-14
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,6 @@ elasticsearch:
390390
javaagent:
391391
- org.elasticsearch:elasticsearch:[6.0.0,8.0.0)
392392
- org.elasticsearch.client:transport:[6.0.0,)
393-
- name: elasticsearch-rest-common-5.0
394-
srcPath: instrumentation/elasticsearch/elasticsearch-rest-common-5.0
395-
target_versions:
396-
javaagent: []
397-
library: []
398393
- name: elasticsearch-transport-5.0
399394
srcPath: instrumentation/elasticsearch/elasticsearch-transport-5.0
400395
target_versions:
@@ -842,10 +837,6 @@ kafka:
842837
target_versions:
843838
library:
844839
- org.apache.kafka:kafka-clients:2.6.0
845-
- name: kafka-clients-common-0.11
846-
srcPath: instrumentation/kafka/kafka-clients/kafka-clients-common-0.11
847-
target_versions:
848-
library: []
849840
- name: kafka-clients-0.11
850841
srcPath: instrumentation/kafka/kafka-clients/kafka-clients-0.11
851842
target_versions:
@@ -1049,11 +1040,6 @@ netty:
10491040
- io.netty:netty-all:[4.1.0.Final,5.0.0)
10501041
library:
10511042
- io.netty:netty-codec-http:4.1.0.Final
1052-
- name: netty-common-4.0
1053-
srcPath: instrumentation/netty/netty-common-4.0
1054-
target_versions:
1055-
javaagent: []
1056-
library: []
10571043
okhttp:
10581044
instrumentations:
10591045
- name: okhttp-3.0

instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/DocGeneratorApplication.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class DocGeneratorApplication {
2020

2121
private static final Logger logger = Logger.getLogger(DocGeneratorApplication.class.getName());
2222

23-
public static void main(String[] args) throws IOException {
23+
public static void main(String[] args) {
2424
FileManager fileManager = new FileManager("instrumentation/");
2525
List<InstrumentationEntity> entities = new InstrumentationAnalyzer(fileManager).analyze();
2626

instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/InstrumentationAnalyzer.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import io.opentelemetry.instrumentation.docs.utils.FileManager;
1616
import io.opentelemetry.instrumentation.docs.utils.InstrumentationPath;
1717
import io.opentelemetry.instrumentation.docs.utils.YamlHelper;
18-
import java.io.IOException;
1918
import java.util.ArrayList;
2019
import java.util.HashMap;
2120
import java.util.HashSet;
@@ -67,7 +66,7 @@ public static List<InstrumentationEntity> convertToEntities(List<Instrumentation
6766
*
6867
* @return a list of InstrumentationEntity objects with target versions
6968
*/
70-
List<InstrumentationEntity> analyze() throws IOException {
69+
List<InstrumentationEntity> analyze() {
7170
List<InstrumentationPath> paths = fileSearch.getInstrumentationPaths();
7271
List<InstrumentationEntity> entities = convertToEntities(paths);
7372

instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/utils/FileManager.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public List<InstrumentationPath> getInstrumentationPaths() {
2929

3030
try (Stream<Path> walk = Files.walk(rootPath)) {
3131
return walk.filter(Files::isDirectory)
32-
.filter(dir -> !dir.toString().contains("/build"))
3332
.filter(dir -> isValidInstrumentationPath(dir.toString()))
3433
.map(dir -> parseInstrumentationPath(dir.toString()))
3534
.collect(Collectors.toList());
@@ -77,7 +76,9 @@ public static boolean isValidInstrumentationPath(String filePath) {
7776

7877
if (filePath.contains("/test/")
7978
|| filePath.contains("/testing")
79+
|| filePath.contains("/build/")
8080
|| filePath.contains("-common/")
81+
|| filePath.contains("-common-")
8182
|| filePath.contains("bootstrap/src")) {
8283
return false;
8384
}

instrumentation-docs/src/test/java/io/opentelemetry/instrumentation/docs/utils/FileManagerTest.java

+8
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ void testIsValidInstrumentationPath() {
4444
assertThat(FileManager.isValidInstrumentationPath("/instrumentation/test/javaagent")).isFalse();
4545
}
4646

47+
@Test
48+
void testExcludesCommonModules() {
49+
assertThat(
50+
FileManager.isValidInstrumentationPath(
51+
"instrumentation/elasticsearch/elasticsearch-rest-common-5.0"))
52+
.isFalse();
53+
}
54+
4755
@Test
4856
void testFindBuildGradleFiles() throws IOException {
4957
Path gradleFile = Files.createFile(tempDir.resolve("build.gradle.kts"));

0 commit comments

Comments
 (0)