Skip to content

Distributed Tracing

As a microservice, IDVoice Server supports providing correlation ID and tracing ID fields in request header which can be use for distributed tracing.

Here's an example of a liveness check request done using curl utility providing the session-id and correlation-id headers:

curl "<host>/liveness_engine/check_liveness_file" -f audio_file=@audio.wav -H 'session-id:12345678' -H 'correlation-id:87654321'

Here's how it will look in the container's logs:

2024-04-18T09:48:42.609+02:00  INFO 432017 --- [VoiceSDK Server] [nio-8080-exec-1] '[][]'o.s.web.servlet.DispatcherServlet        : Completed initialization in 0 ms
2024-04-18T09:48:42.643+02:00 DEBUG 432017 --- [VoiceSDK Server] [nio-8080-exec-1] '[12345678][87654321]'n.i.v.server.web.LivenessRestController  : Incoming request from 127.0.0.1
2024-04-18T09:48:43.185+02:00 DEBUG 432017 --- [VoiceSDK Server] [nio-8080-exec-1] '[12345678][87654321] 'n.i.v.server.web.LivenessRestController  : Engine call successful: LivenessResult{statusCode=OK, value=LivenessResult.Value{score=-0.4149, probability=0.0379}}, took 540 ms

The output format of IDs can be changed by setting the LOGGING_PATTERN_CORRELATION environment variable, e.g --env LOGGING_PATTERN_CORRELATION='[session-id=%X{session-id:-}, correlation-id=%X{correlation-id:-}] ':

2024-04-18T10:02:20.202+02:00  INFO 436740 --- [VoiceSDK Server] [nio-8080-exec-1] '[session-id=, correlation-id=] 'o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
2024-04-18T10:02:20.240+02:00 DEBUG 436740 --- [VoiceSDK Server] [nio-8080-exec-1] '[session-id=12345678, correlation-id=87654321] 'n.i.v.server.web.LivenessRestController  : Incoming request from 127.0.0.1
2024-04-18T10:02:20.745+02:00 DEBUG 436740 --- [VoiceSDK Server] [nio-8080-exec-1] '[session-id=12345678, correlation-id=87654321] 'n.i.v.server.web.LivenessRestController  : Engine call successful: LivenessResult{statusCode=OK, value=LivenessResult.Value{score=-0.4149, probability=0.0379}}, took 504 ms