Patron microservices can interact with other microservices, APIs and applications using a number of clients.
All clients contain integrated tracing powered by opentracing-go
; any new clients should attempt to do the same.
Third-party dependencies
github.com/opentracing/opentracing-go v1.1.0
Patron provides an HTTP client which integrates tracing into all outgoing requests by wrapping the default net/http
client. Users can configure the client's Timeout, RoundTripper and/or set up a circuit breaker.
The AMQP client allows users to connect to a RabbitMQ instance and publish JSON or Protobuf messages using a fan-out exchange. The published messages have integrated tracing headers by default. Users can configure the timeout for connecting to the RabbitMQ instance.
Third-party dependencies
github.com/streadway/amqp v0.0.0-20180315184602-8e4aba63da9f
The gRPC client initiates a client connection to a given target while injecting a UnaryInterceptor
to integrate tracing capabilities. By default, this is a non-blocking connection and users can pass in any number of grpc.DialOption
arguments to configure its behavior.
Third-party dependencies
google.golang.org/grpc v1.27.1
The Kafka client allows users to create a synchronous or asynchronous Kafka producer and publish Kafka messages with tracing headers. The builder pattern allows users to configure the Kafka version, the dial timeout, the RequiredAcks policy, as well as the encoder used to serialize the messages.
Third-party dependencies
github.com/Shopify/sarama v1.21.0
The Redis client allows users to connect to a Redis instance and execute commands. The connection can be configured using redis.Options
.
Third-party dependencies
github.com/go-redis/redis/v7 v7.0.0-beta.5
The SQL client enhances the standard library SQL by integrating tracing capabilities. It has support for prepared statements, queries, as well as low-level handling of transactions.
The SNS and SQS clients provide a set of interfaces and structs useful for publishing messages to AWS SNS and SQS, with integrating tracing.
Third-party dependencies
github.com/aws/aws-sdk-go v1.21.8
The Elasticsearch client allows users to connect to an elasticsearch instance. Its behavior can be configured by providing an elasticsearch.Config
struct
Third-party dependencies
github.com/elastic/go-elasticsearch/v8 v8.0.0-20190731061900-ea052088db25