using System; using System.Collections.Generic; using System.Text; namespace Grpc.Extension { /// /// JaegerOptions /// public class JaegerOptions { /// /// 是否启用Jaeger /// public bool Enable { get; set; } = true; /// /// 服务名 /// public string ServiceName { get; set; } /// /// AgentIp /// public string AgentIp { get; set; } /// /// AgentPort /// public int AgentPort { get; set; } /// /// 检查参数配制 /// /// public bool CheckConfig() { var key = "Jaeger"; if (this.Enable == false) return false; if (string.IsNullOrWhiteSpace(this.ServiceName)) throw new ArgumentException($"{key}:ServiceName Value cannot be null"); if (string.IsNullOrWhiteSpace(this.AgentIp)) throw new ArgumentException($"{key}:AgentIp Value cannot be null"); if (this.AgentPort == 0) throw new ArgumentNullException($"{key}:AgentPort Value cannot be null"); return true; } } }