public MediatrDiagnosticListener(IApmAgent apmAgent)
 {
     _apmAgent  = apmAgent;
     _apmLogger = apmAgent.Logger;
 }
 protected HttpDiagnosticListenerImplBase(IApmAgent components)
 {
     _logger = components.Logger?.Scoped("HttpDiagnosticListenerImplBase");
     _configurationReader = components.ConfigurationReader;
 }
 public EfCoreDiagnosticListener(IApmAgent agent) => _agent = agent;
 public AspNetCoreDiagnosticListener(IApmAgent agent)
 {
     _agent              = agent;
     _logger             = agent.Logger?.Scoped(nameof(AspNetCoreDiagnosticListener));
     _confgurationReader = agent.ConfigurationReader;
 }
 public AspNetCoreDiagnosticListener(IApmAgent agent) => _logger = agent.Logger;
Example #6
0
 internal Span StartSpan(IApmAgent agent, IDbCommand dbCommand) =>
 (Span)ExecutionSegmentCommon.GetCurrentExecutionSegment(agent).StartSpan(dbCommand.CommandText.Replace(Environment.NewLine, " ")
                                                                          , ApiConstants.TypeDb);
Example #7
0
 public AspNetCoreDiagnosticListener(IApmAgent agent) => _agent = agent;
Example #8
0
 public MongoDiagnosticListener(IApmAgent apmAgent) : base(apmAgent)
 {
 }
Example #9
0
 public SqlClientDiagnosticListener(IApmAgent apmAgent)
 {
     _apmAgent = (ApmAgent)apmAgent;
     _logger   = _apmAgent.Logger.Scoped(nameof(SqlClientDiagnosticListener));
 }
Example #10
0
        internal Span StartSpan(IApmAgent agent, IDbCommand dbCommand, InstrumentationFlag instrumentationFlag, string subType = null)
        {
            var spanName = dbCommand.CommandText.Replace(Environment.NewLine, " ");

            return(ExecutionSegmentCommon.StartSpanOnCurrentExecutionSegment(agent, spanName, ApiConstants.TypeDb, subType, instrumentationFlag));
        }
Example #11
0
 public HttpDiagnosticListenerFullFrameworkImpl(IApmAgent agent)
     : base(agent)
 {
 }
Example #12
0
 // This constructor is used only by tests that don't care about sampling and distributed tracing
 internal Transaction(IApmAgent agent, string name, string type)
     : this(agent.Logger, name, type, new Sampler(1.0), null, agent.PayloadSender)
 {
 }
 public SqlClientDiagnosticListener(IApmAgent apmAgent) : base(apmAgent) => _agent = apmAgent as ApmAgent;
 public RequestPipelineDiagnosticsListener(IApmAgent agent) : base(agent) =>
Example #15
0
 public RequestPipelineDiagnosticsListener(IApmAgent agent) : base(agent, DiagnosticSources.RequestPipeline.SourceName) =>
        public ISpan StartSpan(IApmAgent agent, string method, Uri requestUrl, Func <string, string> headerGetter)
        {
            var    blobUrl = new BlobUrl(requestUrl);
            string action  = null;

            switch (method)
            {
            case "DELETE":
                action = "Delete";
                break;

            case "GET":
                if (requestUrl.Query.Contains("restype=container"))
                {
                    if (requestUrl.Query.Contains("comp=list"))
                    {
                        action = "ListBlobs";
                    }
                    else if (requestUrl.Query.Contains("comp=acl"))
                    {
                        action = "GetAcl";
                    }
                    else
                    {
                        action = "GetProperties";
                    }
                }
                else
                {
                    if (requestUrl.Query.Contains("comp=metadata"))
                    {
                        action = "GetMetadata";
                    }
                    else if (requestUrl.Query.Contains("comp=list"))
                    {
                        action = "ListContainers";
                    }
                    else if (requestUrl.Query.Contains("comp=tags"))
                    {
                        action = requestUrl.Query.Contains("where=") ? "FindTags" : "GetTags";
                    }
                    else
                    {
                        action = "Download";
                    }
                }
                break;

            case "HEAD":
                if (requestUrl.Query.Contains("comp=metadata"))
                {
                    action = "GetMetadata";
                }
                else if (requestUrl.Query.Contains("comp=acl"))
                {
                    action = "GetAcl";
                }
                else
                {
                    action = "GetProperties";
                }
                break;

            case "POST":
                if (requestUrl.Query.Contains("comp=batch"))
                {
                    action = "Batch";
                }
                else if (requestUrl.Query.Contains("comp=query"))
                {
                    action = "Query";
                }
                break;

            case "PUT":
                if (!string.IsNullOrEmpty(headerGetter("x-ms-copy-source")))
                {
                    action = "Copy";
                }
                else if (requestUrl.Query.Contains("comp=copy"))
                {
                    action = "Abort";
                }
                else if (!string.IsNullOrEmpty(headerGetter("x-ms-blob-type")) ||
                         requestUrl.Query.Contains("comp=block") ||
                         requestUrl.Query.Contains("comp=blocklist") ||
                         requestUrl.Query.Contains("comp=page") ||
                         requestUrl.Query.Contains("comp=appendblock"))
                {
                    action = "Upload";
                }
                else if (requestUrl.Query.Contains("comp=metadata"))
                {
                    action = "SetMetadata";
                }
                else if (requestUrl.Query.Contains("comp=acl"))
                {
                    action = "SetAcl";
                }
                else if (requestUrl.Query.Contains("comp=properties"))
                {
                    action = "SetProperties";
                }
                else if (requestUrl.Query.Contains("comp=lease"))
                {
                    action = "Lease";
                }
                else if (requestUrl.Query.Contains("comp=snapshot"))
                {
                    action = "Snapshot";
                }
                else if (requestUrl.Query.Contains("comp=undelete"))
                {
                    action = "Undelete";
                }
                else if (requestUrl.Query.Contains("comp=tags"))
                {
                    action = "SetTags";
                }
                else if (requestUrl.Query.Contains("comp=tier"))
                {
                    action = "SetTier";
                }
                else if (requestUrl.Query.Contains("comp=expiry"))
                {
                    action = "SetExpiry";
                }
                else if (requestUrl.Query.Contains("comp=seal"))
                {
                    action = "Seal";
                }
                else
                {
                    action = "Create";
                }

                break;
            }

            if (action is null)
            {
                return(null);
            }

            var name = $"{AzureBlobStorage.SpanName} {action} {blobUrl.ResourceName}";
            var span = ExecutionSegmentCommon.StartSpanOnCurrentExecutionSegment(agent, name,
                                                                                 ApiConstants.TypeStorage, AzureBlobStorage.SubType, InstrumentationFlag.Azure, true, true);

            span.Action = action;
            span.Context.Destination = new Destination
            {
                Address = blobUrl.FullyQualifiedNamespace,
                Service = new Destination.DestinationService
                {
                    Resource = $"{AzureBlobStorage.SubType}/{blobUrl.StorageAccountName}",
                }
            };

            if (span is Span realSpan)
            {
                realSpan.InstrumentationFlag = InstrumentationFlag.Azure;
            }

            return(span);
        }
Example #17
0
 internal static IExecutionSegment GetCurrentExecutionSegment(this IApmAgent agent) =>
 agent.Tracer.CurrentSpan ?? (IExecutionSegment)agent.Tracer.CurrentTransaction;
Example #18
0
 public ApmErrorLogger(IApmAgent agent) => (_agent, _nullScope) = (agent, new NullScope());
Example #19
0
 public HostedService(IApmAgent apmAgent) => _apmAgent = apmAgent;
 public GrpcClientDiagnosticListener(IApmAgent apmAgent) => _agent = apmAgent;
 public HttpDiagnosticListener(IApmAgent components) =>
 (Logger, ConfigurationReader) = (components.Logger, components.ConfigurationReader);
Example #22
0
 public TestListener(IApmAgent apmAgent) : base(apmAgent)
 {
 }
Example #23
0
 protected HttpDiagnosticListenerImplBase(IApmAgent agent)
 {
     _agent = agent;
     Logger = _agent.Logger?.Scoped("HttpDiagnosticListenerImplBase");
 }
 public RabbitMqDiagnosticListener(IApmAgent apmAgent, RabbitMqDiagnosticsOptions options)
 {
     _ApmAgent = apmAgent;
     _Options  = options;
 }
 public HttpDiagnosticListener(IApmAgent components) =>
 (Logger, ConfigurationReader) = (components.Logger?.Scoped(nameof(HttpDiagnosticListener)), components.ConfigurationReader);
 public HttpDiagnosticListenerCoreImpl(IApmAgent agent)
     : base(agent)
 {
 }
Example #27
0
 public EfCoreDiagnosticListener(IApmAgent agent) => Logger = agent.Logger?.Scoped(nameof(EfCoreDiagnosticListener));
Example #28
0
 protected ElasticsearchDiagnosticsListenerBase(IApmAgent agent) : base(agent)
 {
 }
Example #29
0
 public AzureFileShareStorageDiagnosticListener(IApmAgent agent) : base(agent)
 {
 }
Example #30
0
 public GrpcClientDiagnosticListener(IApmAgent apmAgent) : base(apmAgent)
 {
 }