public void Send(ITelemetry item)
        {
            var timer = TimerStrategy();

            if (timer == null || MessageBroker == null)
            {
                return;
            }

            if (item is DependencyTelemetry)
            {
                var dependency = item as DependencyTelemetry;
                var timelineMessage = new DependencyTelemetryTimelineMessage(dependency);
                timelineMessage.Offset = timer.Point().Offset.Subtract(dependency.Duration);
                MessageBroker.Publish(timelineMessage);
            }

            if (item is TraceTelemetry)
            {
                TraceTelemetry t = new TraceTelemetry();

                var model = new TraceMessage
                {
                    Category = "Application Insights",
                    Message = t.SeverityLevel == null ? t.Message : t.SeverityLevel + ": " + t.Message,
                    FromFirst = timer.Point().Offset,
                    FromLast = CalculateFromLast(timer),
                    IndentLevel = 0
                };

                MessageBroker.Publish(model);
            }

            messageBroker.Publish(item);
        }
        /// <summary>
        /// Sends telemetry data item to the configured channel if the instrumentation key
        /// is not empty. Also publishes the telemetry item to the MessageBroker. Filters
        /// out the requests to Glimpse handler.
        /// </summary>
        /// <param name="item">Item to send.</param>
        public void Send(ITelemetry item)
        {
            var timer = this.TimerStrategy();

            if (item == null || timer == null || this.MessageBroker == null)
            {
                return;
            }

            // Filter the request telemetry to glimpse.axd
            if (item is RequestTelemetry)
            {
                var request = item as RequestTelemetry;
                if (request.Url != null && request.Url.AbsolutePath != null)
                {
                    if (request.Url.AbsolutePath.ToLower().EndsWith("glimpse.axd"))
                    {
                        return;
                    }
                }
            }

            if (item is DependencyTelemetry)
            {
                var dependency = item as DependencyTelemetry;
                var timelineMessage = new DependencyTelemetryTimelineMessage(dependency);
                timelineMessage.Offset = timer.Point().Offset.Subtract(dependency.Duration);
                this.MessageBroker.Publish(timelineMessage);
            }

            if (item is TraceTelemetry)
            {
                TraceTelemetry t = new TraceTelemetry();

                var model = new TraceMessage
                {
                    Category = "Application Insights",
                    Message = t.SeverityLevel == null ? t.Message : t.SeverityLevel + ": " + t.Message,
                    FromFirst = timer.Point().Offset,
                    FromLast = this.CalculateFromLast(timer),
                    IndentLevel = 0
                };
                this.MessageBroker.Publish(model);
            }

            // Filter telemetry with empty instrumentation key
            if (item.Context.InstrumentationKey!=null && !item.Context.InstrumentationKey.Equals("00000000-0000-0000-0000-000000000000"))
            {
                this.ApplicationInsightsChannel.Send(item);
            }

            this.messageBroker.Publish(item);
        }
        /// <summary>
        /// Sends telemetry data item to the configured channel if the instrumentation key
        /// is not empty. Also publishes the telemetry item to the MessageBroker. Filters
        /// out the requests to Glimpse handler.
        /// </summary>
        /// <param name="item">Item to send.</param>
        public void Send(ITelemetry item)
        {
            var timer = this.TimerStrategy();

            if (item == null || timer == null || this.MessageBroker == null)
            {
                this.SetItemSent(false);
                return;
            }

            // Filter the request telemetry to glimpse.axd
            if (item is RequestTelemetry)
            {
                var request = item as RequestTelemetry;
                if (request.Url != null && request.Url.AbsolutePath != null)
                {
                    if (request.Url.AbsolutePath.ToLower().EndsWith("glimpse.axd"))
                    {
                        this.SetItemSent(false);
                        return;
                    }
                }
            }

             if (item is DependencyTelemetry)
            {
                var dependency = item as DependencyTelemetry;
                var timelineMessage = new DependencyTelemetryTimelineMessage(dependency);
                timelineMessage.Offset = timer.Point().Offset.Subtract(dependency.Duration);
                this.MessageBroker.Publish(timelineMessage);
            }

            if (item is TraceTelemetry)
            {
                var trace = item as TraceTelemetry;
                var traceMessage = new TraceTelemetryTraceMessage(trace);
                traceMessage.FromFirst = timer.Point().Offset;
                traceMessage.FromLast = this.CalculateFromLast(timer);
                this.MessageBroker.Publish(traceMessage);
            }

            if (item is EventTelemetry)
            {
                var eventT = item as EventTelemetry;
                var eventMessage = new EventTelemetryTraceMessage(eventT);
                eventMessage.FromFirst = timer.Point().Offset;
                eventMessage.FromLast = this.CalculateFromLast(timer);
                this.MessageBroker.Publish(eventMessage);
            }

            if (item is ExceptionTelemetry)
            {
                var trace = item as ExceptionTelemetry;
                var traceMessage = new ExceptionTelemetryTraceMessage(trace);
                traceMessage.FromFirst = timer.Point().Offset;
                traceMessage.FromLast = this.CalculateFromLast(timer);
                this.MessageBroker.Publish(traceMessage);
            }


            // Filter telemetry with empty instrumentation key
            if (item.Context.InstrumentationKey != null && !item.Context.InstrumentationKey.Equals("00000000-0000-0000-0000-000000000000"))
            {
                this.ApplicationInsightsChannel.Send(item);
                this.SetItemSent(true);
            }

            this.messageBroker.Publish(item);
            this.SetItemSent(true);
        }