@@ -390,51 +390,105 @@ If an exporter is present in the classpath during runtime and a spring bean of t
390
390
391
391
#### Configuration Properties
392
392
393
- ##### Enabling/Disabling Features
394
-
395
- | Feature | Property | Default Value | ConditionalOnClass |
396
- | ------------------| ---------------------------------------------| ---------------| ------------------------|
397
- | spring-web | otel.instrumentation.spring-webmvc.enabled | ` true ` | RestTemplate |
398
- | spring-webmvc | otel.instrumentation.spring-web.enabled | ` true ` | OncePerRequestFilter |
399
- | spring-webflux | otel.instrumentation.spring-webflux.enabled | ` true ` | WebClient |
400
- | @WithSpan | otel.instrumentation.annotations.enabled | ` true ` | WithSpan, Aspect |
401
- | Otlp Exporter | otel.exporter.otlp.enabled | ` true ` | OtlpGrpcSpanExporter |
402
- | Jaeger Exporter | otel.exporter.jaeger.enabled | ` true ` | JaegerGrpcSpanExporter |
403
- | Zipkin Exporter | otel.exporter.zipkin.enabled | ` true ` | ZipkinSpanExporter |
404
- | Logging Exporter | otel.exporter.logging.enabled | ` true ` | LoggingSpanExporter |
393
+ ##### Enabling/Disabling Exporters
394
+
395
+ All exporters can be enabled or disabled as in the
396
+ [ SDK auto-configuration] ( https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#exporters ) .
397
+ This is the preferred way to enable/disable exporters and takes precedence over the properties below.
398
+
399
+ | Feature | Property | Default Value | ConditionalOnClass |
400
+ | -----------------------| ---------------------------------------------| ---------------| ---------------------------|
401
+ | Otlp Exporter | otel.exporter.otlp.enabled | ` true ` | - |
402
+ | Otlp Span Exporter | otel.exporter.otlp.traces.enabled | ` true ` | OtlpGrpcSpanExporter |
403
+ | Otlp Metrics Exporter | otel.exporter.otlp.metrics.enabled | ` true ` | OtlpGrpcMetricExporter |
404
+ | Otlp Logs Exporter | otel.exporter.otlp.logs.enabled | ` true ` | OtlpGrpcLogRecordExporter |
405
+ | Jaeger Exporter | otel.exporter.jaeger.enabled | ` true ` | JaegerGrpcSpanExporter |
406
+ | Zipkin Exporter | otel.exporter.zipkin.enabled | ` true ` | ZipkinSpanExporter |
407
+ | Logging Exporter | otel.exporter.logging.enabled | ` false ` | LoggingSpanExporter |
405
408
406
409
<!-- Slf4j Log Correlation otel.springboot.loggers.slf4j.enabled true org.slf4j.MDC -->
407
410
408
- ##### Resource Properties
411
+ ##### Enabling/Disabling Features
409
412
410
- | Feature | Property | Default Value |
411
- | -------- | ------------------------------------------------ | ---------------------- |
412
- | Resource | otel.springboot.resource.enabled | ` true ` |
413
- | | otel.springboot.resource.attributes.service.name | ` unknown_service:java ` |
414
- | | otel.springboot.resource.attributes | ` empty map ` |
413
+ | Feature | Property | Default Value | ConditionalOnClass |
414
+ | -----------------------| ---------------------------------------------| ---------------| ---------------------------|
415
+ | spring-web | otel.instrumentation.spring-webmvc.enabled | ` true ` | RestTemplate |
416
+ | spring-webmvc | otel.instrumentation.spring-web.enabled | ` true ` | OncePerRequestFilter |
417
+ | spring-webflux | otel.instrumentation.spring-webflux.enabled | ` true ` | WebClient |
418
+ | @WithSpan | otel.instrumentation.annotations.enabled | ` true ` | WithSpan, Aspect |
415
419
416
- ` unknown_service:java ` will be used as the service-name if no value has been specified to the
417
- property ` spring.application.name ` or ` otel.springboot.resource.attributes.service.name ` (which has
418
- the highest priority)
420
+ ##### Resource Properties
421
+
422
+ | Feature | Property | Default Value |
423
+ | -------- | ---------------------------------------------------------------------| ---------------------- |
424
+ | Resource | otel.springboot.resource.enabled | ` true ` |
425
+ | | otel.resource.attributes (old: otel.springboot.resource.attributes) | ` empty map ` |
419
426
420
- ` otel.springboot. resource.attributes ` supports a pattern-based resource configuration in the
427
+ ` otel.resource.attributes ` supports a pattern-based resource configuration in the
421
428
application.properties like this:
422
429
423
430
```
424
- otel.springboot.resource.attributes.environment=dev
425
- otel.springboot.resource.attributes.xyz=foo
431
+ otel.resource.attributes.environment=dev
432
+ otel.resource.attributes.xyz=foo
433
+ ```
434
+
435
+ It's also possible to specify the resource attributes in ` application.yaml ` :
436
+
437
+ ``` yaml
438
+ otel :
439
+ resource :
440
+ attributes :
441
+ environment : dev
442
+ xyz : foo
443
+ ` ` `
444
+
445
+ Finally, the resource attributes can be specified as a comma-separated list, as described in the
446
+ [specification](https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/#otel_resource_attributes):
447
+
448
+ ` ` ` shell
449
+ export OTEL_RESOURCE_ATTRIBUTES="key1=value1,key2=value2"
426
450
```
427
451
452
+ The service name is determined by the following precedence, in accordance with the OpenTelemetry
453
+ [ specification] ( https://opentelemetry.io/docs/concepts/sdk-configuration/general-sdk-configuration/#otel_service_name ) :
454
+
455
+ 1 . ` otel.service.name ` spring property or ` OTEL_SERVICE_NAME ` environment variable (highest
456
+ precedence)
457
+ 2 . ` service.name ` in ` otel.resource.attributes ` system/spring property or ` OTEL_RESOURCE_ATTRIBUTES `
458
+ environment variable
459
+ 3 . ` service.name ` in ` otel.springboot.resource.attributes ` system/spring property
460
+ 4 . ` spring.application.name ` spring property
461
+ 5 . the default value ` unknown_service:java ` (lowest precedence)
462
+
428
463
##### Exporter Properties
429
464
430
465
| Feature | Property | Default Value |
431
- | --------------- | ----------------------------- | ------------------------------------ |
466
+ | ----------------- | ------------------------------- | -------------------------------------- |
432
467
| Otlp Exporter | otel.exporter.otlp.endpoint | ` localhost:4317 ` |
468
+ | | otel.exporter.otlp.protocol | ` grpc ` |
469
+ | | otel.exporter.otlp.headers | |
433
470
| | otel.exporter.otlp.timeout | ` 1s ` |
434
471
| Jaeger Exporter | otel.exporter.jaeger.endpoint | ` localhost:14250 ` |
435
472
| | otel.exporter.jaeger.timeout | ` 1s ` |
436
473
| Zipkin Exporter | otel.exporter.jaeger.endpoint | ` http://localhost:9411/api/v2/spans ` |
437
474
475
+ The ` otel.exporter.otlp.headers ` property can be specified as a comma-separated list,
476
+ which is compliant with the
477
+ [ specification] ( https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_headers ) .
478
+ Similar to the resource attributes, the headers can be specified in ` application.properties ` or
479
+ ` application.yaml ` :
480
+
481
+ ``` yaml
482
+ otel :
483
+ exporter :
484
+ otlp :
485
+ headers :
486
+ - key : " header1"
487
+ value : " value1"
488
+ - key : " header2"
489
+ value : " value2"
490
+ ` ` `
491
+
438
492
##### Tracer Properties
439
493
440
494
| Feature | Property | Default Value |
0 commit comments