File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
src/main/kotlin/no/nav/navansatt Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 31
31
<type >pom</type >
32
32
<scope >import</scope >
33
33
</dependency >
34
+ <dependency >
35
+ <groupId >io.opentelemetry</groupId >
36
+ <artifactId >opentelemetry-bom</artifactId >
37
+ <version >1.37.0</version >
38
+ <type >pom</type >
39
+ <scope >import</scope >
40
+ </dependency >
34
41
</dependencies >
35
42
</dependencyManagement >
36
43
80
87
<groupId >io.ktor</groupId >
81
88
<artifactId >ktor-metrics-micrometer</artifactId >
82
89
</dependency >
90
+
91
+
92
+ <dependency >
93
+ <groupId >io.opentelemetry</groupId >
94
+ <artifactId >opentelemetry-api</artifactId >
95
+ </dependency >
96
+ <dependency >
97
+ <groupId >io.opentelemetry.instrumentation</groupId >
98
+ <artifactId >opentelemetry-instrumentation-annotations</artifactId >
99
+ <version >2.3.0</version >
100
+ </dependency >
101
+
102
+ <!-- Probably not needed
103
+ <dependency>
104
+ <groupId>io.opentelemetry</groupId>
105
+ <artifactId>opentelemetry-sdk</artifactId>
106
+ </dependency>
107
+ <dependency>
108
+ <groupId>io.opentelemetry</groupId>
109
+ <artifactId>opentelemetry-exporter-logging</artifactId>
110
+ </dependency>
111
+ <dependency>
112
+ <groupId>io.opentelemetry.semconv</groupId>
113
+ <artifactId>opentelemetry-semconv</artifactId>
114
+ <version>1.25.0-alpha</version>
115
+ </dependency>
116
+
117
+
118
+ <dependency>
119
+ <groupId>io.opentelemetry</groupId>
120
+ <artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId>
121
+ </dependency>
122
+ <dependency>
123
+ <groupId>io.opentelemetry</groupId>
124
+ <artifactId>opentelemetry-sdk-extension-autoconfigure-spi</artifactId>
125
+ </dependency>
126
+ -->
83
127
<dependency >
84
128
<groupId >io.micrometer</groupId >
85
129
<artifactId >micrometer-registry-prometheus</artifactId >
Original file line number Diff line number Diff line change 1
1
package no.nav.navansatt
2
2
3
+ import io.opentelemetry.api.GlobalOpenTelemetry
3
4
import kotlinx.coroutines.Dispatchers
4
5
import kotlinx.coroutines.withContext
5
6
import org.apache.commons.text.StringEscapeUtils
7
+ import io.opentelemetry.api.OpenTelemetry;
8
+ import io.opentelemetry.api.trace.Tracer;
9
+ import io.opentelemetry.instrumentation.annotations.WithSpan
6
10
import org.slf4j.LoggerFactory
7
11
import java.util.Hashtable
8
12
import java.util.regex.Pattern
@@ -41,6 +45,7 @@ class ActiveDirectoryClient(
41
45
}
42
46
}
43
47
48
+ @WithSpan
44
49
suspend fun getUsers (idents : List <String >): List <User > = withContext(Dispatchers .IO ) {
45
50
val root = InitialLdapContext (env, null )
46
51
@@ -89,6 +94,7 @@ class ActiveDirectoryClient(
89
94
users
90
95
}
91
96
97
+ @WithSpan
92
98
suspend fun getUser (ident : String ): User ? = withContext(Dispatchers .IO ) {
93
99
val root = InitialLdapContext (env, null )
94
100
You can’t perform that action at this time.
0 commit comments