Tapper v0.1.1 Tapper.Endpoint
Endpoint description struct; used everywhere an endpoint is required.
Example
endpoint = %Endpoint{
ip: {192, 168, 10, 100},
service_name: "my-service",
port: 80
}
Tapper.server_address(id, endpoint)
The ip
field is either an IPV4 or an IPV6 address, as a 4- or 8-tuple; the
port will default to 0
.
Instead of an ip
address, the hostname
field can provide a DNS name
(as a String.t
or atom
) which will be resolved to an IP address
(see Tapper.Tracer.Trace.Convert
) when the span is reported:
endpoint = %Endpoint{
hostname: "my-service.ft.com",
service_name: "my-service",
port: 80
}
NB because DNS resolution happens asynchronously, the resulting IP address may not correspond the actual IP address connected to, e.g. if the service is being IP load-balanced (e.g. by A record or AWS ALB). You can use the
resolve/1
function before sending an annotation to make it slightly more likely to be the same IP address, at the expense of doing this in the client process, rather than in Tapper’s server.
Summary
Functions
get the first non-loopback IP interface address tuple, preferring ipv4 over ip6
Types
t() :: %Tapper.Endpoint{hostname: String.t | atom | nil, ip: ip_address | nil, port: integer | nil, service_name: String.t | nil}
Functions
get the first non-loopback IP interface address tuple, preferring ipv4 over ip6