Our great sponsors
-
kafkacat
Discontinued Generic command line non-JVM Apache Kafka producer and consumer [Moved to: https://github.com/edenhill/kcat]
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
libcurl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. libcurl offers a myriad of powerful features
I've created this spring-cloud-sleuth-in-action sample to use some of these integrations executing the following flow:
Consume from the Kafka topic my.topic with kafkacat:
The default format for context propagation is B3 so we use headers X-B3-TraceId and X-B3-SpanId
We need to add traceId and spanId values to the application log. In production we would use the logstash-logback-encoder to generate logs in JSON format and send them to an ELK but for the demo we use this plain text logback layout:
In production we would send to zipkin a small percentage of all the traces (sampling) but for the demo we will send all of them:
Execute a request to the first endpoint with curl or any other tool you like: