@@ -2332,27 +2332,64 @@ class ConfigTest extends DDSpecification {
2332
2332
! hostname. trim(). isEmpty()
2333
2333
}
2334
2334
2335
- def " config instantiation should fail if llm obs is enabled via sys prop and ml app is not set" () {
2335
+ def " config instantiation should NOT fail if llm obs is enabled via sys prop and ml app is not set" () {
2336
2336
setup :
2337
2337
Properties properties = new Properties ()
2338
2338
properties. setProperty(LLMOBS_ENABLED , " true" )
2339
+ properties. setProperty(SERVICE , " test-service" )
2339
2340
2340
2341
when :
2341
- new Config (ConfigProvider . withPropertiesOverride(properties))
2342
+ def config = new Config (ConfigProvider . withPropertiesOverride(properties))
2343
+
2344
+ then :
2345
+ noExceptionThrown()
2346
+ config. isLlmObsEnabled()
2347
+ config. llmObsMlApp == " test-service"
2348
+ }
2349
+
2350
+ def " config instantiation should NOT fail if llm obs is enabled via sys prop and ml app is empty" () {
2351
+ setup :
2352
+ Properties properties = new Properties ()
2353
+ properties. setProperty(LLMOBS_ENABLED , " true" )
2354
+ properties. setProperty(SERVICE , " test-service" )
2355
+ properties. setProperty(LLMOBS_ML_APP , " " )
2356
+
2357
+ when :
2358
+ def config = new Config (ConfigProvider . withPropertiesOverride(properties))
2342
2359
2343
2360
then :
2344
- thrown IllegalArgumentException
2361
+ noExceptionThrown()
2362
+ config. isLlmObsEnabled()
2363
+ config. llmObsMlApp == " test-service"
2345
2364
}
2346
2365
2347
- def " config instantiation should fail if llm obs is enabled via env var and ml app is not set" () {
2366
+ def " config instantiation should NOT fail if llm obs is enabled via env var and ml app is not set" () {
2348
2367
setup :
2349
2368
environmentVariables. set(DD_LLMOBS_ENABLED_ENV , " true" )
2369
+ environmentVariables. set(DD_SERVICE_NAME_ENV , " test-service" )
2350
2370
2351
2371
when :
2352
- new Config ()
2372
+ def config = new Config ()
2353
2373
2354
2374
then :
2355
- thrown IllegalArgumentException
2375
+ noExceptionThrown()
2376
+ config. isLlmObsEnabled()
2377
+ config. llmObsMlApp == " test-service"
2378
+ }
2379
+
2380
+ def " config instantiation should NOT fail if llm obs is enabled via env var and ml app is empty" () {
2381
+ setup :
2382
+ environmentVariables. set(DD_LLMOBS_ENABLED_ENV , " true" )
2383
+ environmentVariables. set(DD_SERVICE_NAME_ENV , " test-service" )
2384
+ environmentVariables. set(DD_LLMOBS_ML_APP_ENV , " " )
2385
+
2386
+ when :
2387
+ def config = new Config ()
2388
+
2389
+ then :
2390
+ noExceptionThrown()
2391
+ config. isLlmObsEnabled()
2392
+ config. llmObsMlApp == " test-service"
2356
2393
}
2357
2394
2358
2395
0 commit comments