public void OrleansOnActivate([Object] KanekoExcuteData eventData)
        {
            var context = _tracingContext.CreateEntrySegmentContext(eventData.OperatioName, new HttpRequestCarrierHeaderCollection(eventData.SW8));

            context.Span.Component = GetComponent();
            context.Span.Peer      = new StringOrIntValue(eventData.GetRuntimeIdentity());
            context.Span.AddTag("grain.instance", eventData.GrainType);
            context.Span.AddTag("grain.identity", eventData.GrainId);
            context.Span.AddLog(LogEvent.Message($"Grain on activate"));
        }
Example #2
0
 public static void OrleansInvokeAfter(this DiagnosticListener listener, long tracingTimestamp)
 {
     if (listener.IsEnabled(KanekoDiagnosticListenerNames.OrleansInvokeAfter))
     {
         var now        = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
         var excuteData = new KanekoExcuteData
         {
             ElapsedTimeMs = now - tracingTimestamp,
         };
         listener.Write(KanekoDiagnosticListenerNames.OrleansInvokeAfter, excuteData);
     }
 }
        public void OrleansInvokeAfter([Object] KanekoExcuteData eventData)
        {
            var context = _entrySegmentContextAccessor.Context;

            if (context == null)
            {
                return;
            }

            context.Span.AddLog(LogEvent.Message($"Grain finished spend time: " + eventData.ElapsedTimeMs + "ms"));
            _tracingContext.Release(context);
        }
        public void OrleansInvokeError([Object] KanekoExcuteData eventData)
        {
            var context = _entrySegmentContextAccessor.Context;

            if (context == null)
            {
                return;
            }

            context.Span.AddLog(LogEvent.Message($"Grain Error spend time: " + eventData.ElapsedTimeMs + "ms"));
            context.Span?.ErrorOccurred(eventData.Exception);
            _tracingContext.Release(context);
        }
Example #5
0
        public static long OrleansOnActivate(this DiagnosticListener listener, Type type, string grainId, string runtimeIdentity, string sw8)
        {
            if (listener.IsEnabled(KanekoDiagnosticListenerNames.OrleansOnActivate))
            {
                var now        = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
                var excuteData = new KanekoExcuteData
                {
                    OperatioName    = type?.Name,
                    GrainId         = grainId,
                    GrainType       = type?.FullName,
                    RuntimeIdentity = runtimeIdentity,
                    SW8             = sw8
                };
                listener.Write(KanekoDiagnosticListenerNames.OrleansOnActivate, excuteData);

                return(now);
            }

            return(0);
        }