public void SetNamespace()

in sdk/src/Core/AWSXRayRecorderImpl.cs [296:325]


        public void SetNamespace(string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                throw new ArgumentException("Value cannot be null or empty.", nameof(value));
            }

            if (IsTracingDisabled())
            {
                _logger.DebugFormat("X-Ray tracing is disabled, do not set namespace.");
                return;
            }

            try
            {
                var subsegment = TraceContext.GetEntity() as Subsegment;

                if (subsegment == null)
                {
                    _logger.DebugFormat("Failed to cast the entity from TraceContext to Subsegment. SetNamespace is only available to Subsegment.");
                    return;
                }

                subsegment.Namespace = value;
            }
            catch (EntityNotAvailableException e)
            {
                HandleEntityNotAvailableException(e, "Failed to set namespace because of subsegment is not available.");
            }
        }