예제 #1
0
        public void StartActorActive(
            bool firstActivation)
        {
            PersonActorServiceEventSource.Current.StartActorActive(
                _actor,
                firstActivation
                );

            var actorActiveOperationHolder = _telemetryClient.StartOperation <RequestTelemetry>("actorActive");

            actorActiveOperationHolder.Telemetry.Properties.Add("ActorType", _actor.ActorType.ToString());
            actorActiveOperationHolder.Telemetry.Properties.Add("ActorId", _actor.ActorId.ToString());
            actorActiveOperationHolder.Telemetry.Properties.Add("ApplicationTypeName", _actor.ApplicationTypeName);
            actorActiveOperationHolder.Telemetry.Properties.Add("ApplicationName", _actor.ApplicationName);
            actorActiveOperationHolder.Telemetry.Properties.Add("ServiceTypeName", _actor.ServiceTypeName);
            actorActiveOperationHolder.Telemetry.Properties.Add("ServiceName", _actor.ToString());
            actorActiveOperationHolder.Telemetry.Properties.Add("PartitionId", _actor.PartitionId.ToString());
            actorActiveOperationHolder.Telemetry.Properties.Add("ReplicaOrInstanceId", _actor.ReplicaOrInstanceId.ToString());
            actorActiveOperationHolder.Telemetry.Properties.Add("NodeName", _actor.NodeName);
            actorActiveOperationHolder.Telemetry.Properties.Add("FirstActivation", firstActivation.ToString());
            OperationHolder.StartOperation(actorActiveOperationHolder);
        }
예제 #2
0
 public void StopActorActive(
     FG.ServiceFabric.Diagnostics.ActorOrActorServiceDescription actor)
 {
     if (this.IsEnabled())
     {
         StopActorActive(
             actor.ActorType.ToString(),
             actor.ActorId.ToString(),
             actor.ApplicationTypeName,
             actor.ApplicationName,
             actor.ServiceTypeName,
             actor.ToString(),
             actor.PartitionId,
             actor.ReplicaOrInstanceId,
             actor.NodeName);
     }
 }
예제 #3
0
 public void ActorHostInitializationFailed(
     FG.ServiceFabric.Diagnostics.ActorOrActorServiceDescription actor,
     System.Exception ex)
 {
     if (this.IsEnabled())
     {
         ActorHostInitializationFailed(
             actor.ActorType.ToString(),
             actor.ActorId.ToString(),
             actor.ApplicationTypeName,
             actor.ApplicationName,
             actor.ServiceTypeName,
             actor.ToString(),
             actor.PartitionId,
             actor.ReplicaOrInstanceId,
             actor.NodeName,
             ex.Message,
             ex.Source,
             ex.GetType().FullName,
             ex.AsJson());
     }
 }
예제 #4
0
        public System.IDisposable RecieveActorMessage(
            System.Uri requestUri,
            string actorMethodName,
            FG.ServiceFabric.Actors.Remoting.Runtime.ActorMessageHeaders actorMessageHeaders,
            FG.ServiceFabric.Services.Remoting.FabricTransport.CustomServiceRequestHeader customServiceRequestHeader)
        {
            return(new ScopeWrapper(new IDisposable[]
            {
                ScopeWrapperWithAction.Wrap(() =>
                {
                    PersonActorServiceEventSource.Current.StartRecieveActorMessage(
                        _actor,
                        requestUri,
                        actorMethodName,
                        actorMessageHeaders,
                        customServiceRequestHeader
                        );

                    return new ScopeWrapperWithAction(() =>
                    {
                        PersonActorServiceEventSource.Current.StopRecieveActorMessage(
                            _actor,
                            requestUri,
                            actorMethodName,
                            actorMessageHeaders,
                            customServiceRequestHeader
                            );
                    });
                }),


                ScopeWrapperWithAction.Wrap(() =>
                {
                    var recieveActorMessageOperationHolder = _telemetryClient.StartOperation <RequestTelemetry>(requestUri.ToString() ?? "recieveActorMessage");
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("ActorType", _actor.ActorType.ToString());
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("ApplicationTypeName", _actor.ApplicationTypeName);
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("ApplicationName", _actor.ApplicationName);
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("ServiceTypeName", _actor.ServiceTypeName);
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("ServiceName", _actor.ToString());
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("PartitionId", _actor.PartitionId.ToString());
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("ReplicaOrInstanceId", _actor.ReplicaOrInstanceId.ToString());
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("NodeName", _actor.NodeName);
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("RequestUri", requestUri.ToString());
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("ActorMethodName", actorMethodName);
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("InterfaceId", (actorMessageHeaders?.InterfaceId ?? 0).ToString());
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("MethodId", (actorMessageHeaders?.MethodId ?? 0).ToString());
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("ActorId", actorMessageHeaders?.ActorId.ToString());
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("UserId", customServiceRequestHeader?.GetHeader("userId"));
                    recieveActorMessageOperationHolder.Telemetry.Properties.Add("CorrelationId", customServiceRequestHeader?.GetHeader("correlationId"));

                    return new ScopeWrapperWithAction(() =>
                    {
                        _telemetryClient.StopOperation <RequestTelemetry>(recieveActorMessageOperationHolder);
                    });
                }),
            }));
        }