File tree 5 files changed +12
-18
lines changed
main/java/io/opentelemetry/instrumentation/docs
test/java/io/opentelemetry/instrumentation/docs/utils
5 files changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -390,11 +390,6 @@ elasticsearch:
390
390
javaagent :
391
391
- org.elasticsearch:elasticsearch:[6.0.0,8.0.0)
392
392
- 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 : []
398
393
- name : elasticsearch-transport-5.0
399
394
srcPath : instrumentation/elasticsearch/elasticsearch-transport-5.0
400
395
target_versions :
@@ -842,10 +837,6 @@ kafka:
842
837
target_versions :
843
838
library :
844
839
- 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 : []
849
840
- name : kafka-clients-0.11
850
841
srcPath : instrumentation/kafka/kafka-clients/kafka-clients-0.11
851
842
target_versions :
@@ -1049,11 +1040,6 @@ netty:
1049
1040
- io.netty:netty-all:[4.1.0.Final,5.0.0)
1050
1041
library :
1051
1042
- 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 : []
1057
1043
okhttp :
1058
1044
instrumentations :
1059
1045
- name : okhttp-3.0
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public class DocGeneratorApplication {
20
20
21
21
private static final Logger logger = Logger .getLogger (DocGeneratorApplication .class .getName ());
22
22
23
- public static void main (String [] args ) throws IOException {
23
+ public static void main (String [] args ) {
24
24
FileManager fileManager = new FileManager ("instrumentation/" );
25
25
List <InstrumentationEntity > entities = new InstrumentationAnalyzer (fileManager ).analyze ();
26
26
Original file line number Diff line number Diff line change 15
15
import io .opentelemetry .instrumentation .docs .utils .FileManager ;
16
16
import io .opentelemetry .instrumentation .docs .utils .InstrumentationPath ;
17
17
import io .opentelemetry .instrumentation .docs .utils .YamlHelper ;
18
- import java .io .IOException ;
19
18
import java .util .ArrayList ;
20
19
import java .util .HashMap ;
21
20
import java .util .HashSet ;
@@ -67,7 +66,7 @@ public static List<InstrumentationEntity> convertToEntities(List<Instrumentation
67
66
*
68
67
* @return a list of InstrumentationEntity objects with target versions
69
68
*/
70
- List <InstrumentationEntity > analyze () throws IOException {
69
+ List <InstrumentationEntity > analyze () {
71
70
List <InstrumentationPath > paths = fileSearch .getInstrumentationPaths ();
72
71
List <InstrumentationEntity > entities = convertToEntities (paths );
73
72
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ public List<InstrumentationPath> getInstrumentationPaths() {
29
29
30
30
try (Stream <Path > walk = Files .walk (rootPath )) {
31
31
return walk .filter (Files ::isDirectory )
32
- .filter (dir -> !dir .toString ().contains ("/build" ))
33
32
.filter (dir -> isValidInstrumentationPath (dir .toString ()))
34
33
.map (dir -> parseInstrumentationPath (dir .toString ()))
35
34
.collect (Collectors .toList ());
@@ -77,7 +76,9 @@ public static boolean isValidInstrumentationPath(String filePath) {
77
76
78
77
if (filePath .contains ("/test/" )
79
78
|| filePath .contains ("/testing" )
79
+ || filePath .contains ("/build/" )
80
80
|| filePath .contains ("-common/" )
81
+ || filePath .contains ("-common-" )
81
82
|| filePath .contains ("bootstrap/src" )) {
82
83
return false ;
83
84
}
Original file line number Diff line number Diff line change @@ -44,6 +44,14 @@ void testIsValidInstrumentationPath() {
44
44
assertThat (FileManager .isValidInstrumentationPath ("/instrumentation/test/javaagent" )).isFalse ();
45
45
}
46
46
47
+ @ Test
48
+ void testExcludesCommonModules () {
49
+ assertThat (
50
+ FileManager .isValidInstrumentationPath (
51
+ "instrumentation/elasticsearch/elasticsearch-rest-common-5.0" ))
52
+ .isFalse ();
53
+ }
54
+
47
55
@ Test
48
56
void testFindBuildGradleFiles () throws IOException {
49
57
Path gradleFile = Files .createFile (tempDir .resolve ("build.gradle.kts" ));
You can’t perform that action at this time.
0 commit comments