Skip to content

Commit bfe3e90

Browse files
committed
Fix determinism in scope detection
1 parent 684911e commit bfe3e90

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

docs/instrumentation-list.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12964,6 +12964,7 @@ libraries:
1296412964
source_path: instrumentation/servlet/servlet-2.2
1296512965
scope:
1296612966
name: io.opentelemetry.servlet-2.2
12967+
schema_url: https://opentelemetry.io/schemas/1.37.0
1296712968
javaagent_target_versions:
1296812969
- javax.servlet:servlet-api:[2.2, 3.0)
1296912970
configurations:
@@ -13045,6 +13046,7 @@ libraries:
1304513046
source_path: instrumentation/servlet/servlet-3.0
1304613047
scope:
1304713048
name: io.opentelemetry.servlet-3.0
13049+
schema_url: https://opentelemetry.io/schemas/1.37.0
1304813050
has_standalone_library: true
1304913051
javaagent_target_versions:
1305013052
- javax.servlet:javax.servlet-api:[3.0,)

instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/parsers/EmittedScopeParser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.nio.file.Files;
2323
import java.nio.file.Path;
2424
import java.nio.file.Paths;
25+
import java.util.Comparator;
2526
import java.util.HashSet;
2627
import java.util.List;
2728
import java.util.Map;
@@ -52,7 +53,7 @@ public static InstrumentationScopeInfo getScope(
5253
item ->
5354
item.getName() != null
5455
&& item.getName().contains(module.getInstrumentationName()))
55-
.findFirst()
56+
.min(Comparator.comparing(item -> item.getSchemaUrl() == null ? 1 : 0))
5657
.orElse(null);
5758
if (scope == null) {
5859
return null;

0 commit comments

Comments
 (0)