public ZipkinSpanExporter( ILogger <ZipkinSpanExporter> logger, string host, string serviceName, IHttpClientFactory httpClientFactory) { EnsureArg.IsNotNull(logger, nameof(logger)); EnsureArg.IsNotNullOrEmpty(serviceName, nameof(serviceName)); EnsureArg.IsNotNullOrEmpty(host, nameof(host)); this.logger = logger; this.serviceName = serviceName; this.endpoint = $"{host}/api/v2/spans"; this.httpClient = httpClientFactory.CreateClient("zipkin"); this.localEndpoint = this.GetLocalZipkinEndpoint(); }
private ZipkinEndpoint GetLocalZipkinEndpoint() { var result = new ZipkinEndpoint() { ServiceName = this.serviceName, }; var hostName = this.ResolveHostName(); if (!string.IsNullOrEmpty(hostName)) { result.Ipv4 = this.ResolveHostAddress(hostName, AddressFamily.InterNetwork); result.Ipv6 = this.ResolveHostAddress(hostName, AddressFamily.InterNetworkV6); } return(result); }
internal Builder RemoteEndpoint(ZipkinEndpoint val) { this.result.RemoteEndpoint = val; return(this); }
internal Builder LocalEndpoint(ZipkinEndpoint val) { this.result.LocalEndpoint = val; return(this); }