コード例 #1
0
        public void TestDefaultHostTags()
        {
            InMemoryReporter spanReporter = new InMemoryReporter();
            Tracer           tracer       = new Tracer.Builder("x")
                                            .WithReporter(spanReporter)
                                            .Build();

            string hostname = tracer.GetHostName();
            string hostIPv4 = Dns.GetHostAddresses(hostname).First(ip => ip.AddressFamily == AddressFamily.InterNetwork).ToString();

            Assert.Equal(hostname, tracer.Tags[Constants.TracerHostnameTagKey]);
            Assert.Equal(hostIPv4, tracer.Tags[Constants.TracerIpTagKey]);
            Assert.Equal(Utils.IpToInt(hostIPv4), tracer.IPv4);
        }