Trace4cats components can be arranged in a number of differing ways. Either in point-to-point configurations using UDP and TCP connections, or message based configurations using Kafka.
As mentioned above, point-to-point topologies rely on UDP and TCP connections and load balancers.
In a simple configuration the Trace4Cats library can export directly to a tracing system. Please note that this may
inhibit your ability in using Graal native-image
to compile your code.
As mentioned in the readme, SpanExporter
s and SpanCompleter
s may be
combined using its monoid instance. See the
AllCompleters
example
for details.
The Trace4Cats agent is designed to be co-located with the traced application, either on the same machine or as a Kubernetes sidecar. The agent can only forward via TCP to a collector.
The Trace4Cats library can be configured to send directly to the collector via TCP or UDP. While not shown on the diagram, you can deploy multiple instances of the collector behind a load balancer (like in a Kubernetes deployment and service).
The collector can be configured forward on to other collectors. This may be useful if you have multi-region setup where the collector within a region may perform sampling before forwarding to an aggregating collector.
When using Trace4Cats with Kafka, you can do a few more interesting things than with point-to-point connections. The Kafka exporter guarantees that all spans for a single trace will end up on the same topic partition, making collector load balancing and sample decisions easier.
In a simple configuration, the Trace4Cats library can export directly to Kafka.
Similar to above, agent-kafka can be used as a sidecar to send spans directly to Kafka, without having to use the Kafka client within your app.
The Trace4Cats library can be configured to send spans directly to Kafka, note this does mean that ad dependency on the Kafka client will be introduced to your app.
Collectors within different regions may forward to a multi-region Kafka topic, where all spans are then forwarded to a trace system by another collector, or group of collectors using the same consumer group.
Another potential Kafka based topology is where multiple collectors all consume from the same topic with different consumer groups. Each collector could forward to a different trace system, and may have different sampling and filtering configuration.