Пример #1
0
        public void RegisterResourceAttributes(ResourceBuilder resourceBuilder)
        {
            var attributes = new Dictionary <string, object>();

            if (this.Type != null)
            {
                attributes.Add(OpenTelemetryResourceAttributes.AttributeOsType, this.Type);
            }

            if (this.Description != null)
            {
                attributes.Add(OpenTelemetryResourceAttributes.AttributeOsDescription, this.Description);
            }

            resourceBuilder.AddAttributes(attributes);
        }
        public void RegisterResourceAttributes(ResourceBuilder resourceBuilder)
        {
            var attributes = new Dictionary <string, object>();

            if (this.Provider != null)
            {
                attributes.Add(OpenTelemetryResourceAttributes.AttributeCloudProvider, this.Provider);
            }

            if (this.Region != null)
            {
                attributes.Add(OpenTelemetryResourceAttributes.AttributeCloudRegion, this.Region);
            }

            if (this.Zone != null)
            {
                attributes.Add(OpenTelemetryResourceAttributes.AttributeCloudZone, this.Zone);
            }

            resourceBuilder.AddAttributes(attributes);
        }
Пример #3
0
        public void RegisterResourceAttributes(ResourceBuilder resourceBuilder)
        {
            var attributes = new Dictionary <string, object>();

            if (this.Id != null)
            {
                attributes.Add(OpenTelemetryResourceAttributes.AttributeHostId, this.Id);
            }

            if (this.Type != null)
            {
                attributes.Add(OpenTelemetryResourceAttributes.AttributeHostType, this.Type);
            }

            if (this.ImageId != null)
            {
                attributes.Add(OpenTelemetryResourceAttributes.AttributeHostImageName, this.ImageId);
            }

            resourceBuilder.AddAttributes(attributes);
        }