Distributed Tracing ¶
As a microservice, IDVoice CC 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>/voice_template_factory/create_voice_template_from_file" -f wav_file=@audio.wav -H 'session-id:12345678' -H 'correlation-id:87654321'
Here's how it will look in the container's logs:
2024-04-18T10:12:17.320+02:00 INFO 442767 --- [Call Center SDK Server] [nio-8080-exec-1] '[][]'o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms 2024-04-18T10:12:17.354+02:00 DEBUG 442767 --- [Call Center SDK Server] [nio-8080-exec-1] '[12345678][87654321]'n.i.v.s.w.VoiceTemplateFactoryController : Incoming request from 127.0.0.1 2024-04-18T10:12:17.548+02:00 DEBUG 442767 --- [Call Center SDK Server] [nio-8080-exec-1] '[12345678][87654321]'n.i.v.s.w.VoiceTemplateFactoryController : Template created: ab05b001, took 192 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:13:16.480+02:00 INFO 443596 --- [Call Center SDK Server] [nio-8080-exec-1] '[session-id=, correlation-id=] 'o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms 2024-04-18T10:13:16.512+02:00 DEBUG 443596 --- [Call Center SDK Server] [nio-8080-exec-1] '[session-id=12345678, correlation-id=87654321] 'n.i.v.s.w.VoiceTemplateFactoryController : Incoming request from 127.0.0.1 2024-04-18T10:13:16.702+02:00 DEBUG 443596 --- [Call Center SDK Server] [nio-8080-exec-1] '[session-id=12345678, correlation-id=87654321] 'n.i.v.s.w.VoiceTemplateFactoryController : Template created: 70eead16, took 188 ms