Skip to content

Commit cd18275

Browse files
authored
micronaut otel properties Closes #1971 (#1977)
micronaut otel properties
1 parent 2474267 commit cd18275

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

jvm-common/src/main/kotlin/org/digma/intellij/plugin/idea/runcfg/AutoOtelAgentRunConfigurationWrapper.kt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class AutoOtelAgentRunConfigurationWrapper : RunConfigurationWrapper {
7070
params,
7171
useAgent,
7272
isSpringBootWithMicrometerTracing,
73+
isMicronautModule,
7374
isOtelServiceNameAlreadyDefined(params),
7475
runConfigType.isTest
7576
)
@@ -91,6 +92,7 @@ class AutoOtelAgentRunConfigurationWrapper : RunConfigurationWrapper {
9192
params,
9293
useAgent,
9394
isSpringBootWithMicrometerTracing,
95+
isMicronautModule,
9496
isOtelServiceNameAlreadyDefined(params),
9597
runConfigType.isTest
9698
)
@@ -119,6 +121,7 @@ class AutoOtelAgentRunConfigurationWrapper : RunConfigurationWrapper {
119121
params,
120122
useAgent,
121123
isSpringBootWithMicrometerTracing,
124+
isMicronautModule,
122125
isOtelServiceNameAlreadyDefined(configuration),
123126
runConfigType.isTest
124127
)
@@ -137,6 +140,7 @@ class AutoOtelAgentRunConfigurationWrapper : RunConfigurationWrapper {
137140
params,
138141
useAgent,
139142
isSpringBootWithMicrometerTracing,
143+
isMicronautModule,
140144
isOtelServiceNameAlreadyDefined(params),
141145
runConfigType.isTest
142146
)
@@ -190,6 +194,7 @@ class AutoOtelAgentRunConfigurationWrapper : RunConfigurationWrapper {
190194
params: JavaParameters?,
191195
useAgent: Boolean,
192196
isSpringBootWithMicrometerTracing: Boolean,
197+
isMicronautModule: Boolean,
193198
serviceAlreadyDefined: Boolean,
194199
isTest: Boolean,
195200
): String? {
@@ -227,6 +232,23 @@ class AutoOtelAgentRunConfigurationWrapper : RunConfigurationWrapper {
227232
.plus(" ")
228233
}
229234

235+
if (isMicronautModule) {
236+
retVal = retVal
237+
.plus("-Dotel.java.global-autoconfigure.enabled=true")
238+
.plus(" ")
239+
.plus("-Dotel.traces.exporter=otlp")
240+
.plus(" ")
241+
.plus("-Dotel.exporter.otlp.endpoint=${getExporterUrl()}")
242+
.plus(" ")
243+
.plus("-Dotel.exporter.otlp.insecure=true")
244+
.plus(" ")
245+
.plus("-Dotel.exporter.otlp.compression=gzip")
246+
.plus(" ")
247+
.plus("-Dotel.exporter.experimental.expoter.otlp.retry.enabled=true")
248+
.plus(" ")
249+
}
250+
251+
230252
if (isTest) {
231253
if (!alreadyHasTestEnv(configuration, params)) {
232254
val envPart = "digma.environment=${Env.buildEnvForLocalTests()}"

0 commit comments

Comments
 (0)