示例#1
0
        private void ReportIncomingErrors(List <IngestErrorType> errors)
        {
            foreach (IngestErrorType error in errors)
            {
                switch (error)
                {
                case IngestErrorType.Version:
                    _agentHealthReporter.ReportSupportabilityDistributedTraceAcceptPayloadIgnoredMajorVersion();
                    break;

                case IngestErrorType.NullPayload:
                    _agentHealthReporter.ReportSupportabilityDistributedTraceAcceptPayloadIgnoredNull();
                    break;

                case IngestErrorType.ParseException:
                    _agentHealthReporter.ReportSupportabilityDistributedTraceAcceptPayloadParseException();
                    break;

                case IngestErrorType.OtherException:
                    _agentHealthReporter.ReportSupportabilityDistributedTraceAcceptPayloadException();
                    break;

                case IngestErrorType.NotTraceable:
                    Log.Debug("Incoming Guid and TransactionId were null, which is invalid for a Distributed Trace payload.");
                    _agentHealthReporter.ReportSupportabilityDistributedTraceAcceptPayloadParseException();
                    break;

                case IngestErrorType.NotTrusted:
                    Log.Debug($"Incoming trustKey or accountId not trusted, distributed trace payload will be ignored.");
                    _agentHealthReporter.ReportSupportabilityDistributedTraceAcceptPayloadIgnoredUntrustedAccount();
                    break;

                case IngestErrorType.TraceContextAcceptException:
                    Log.Debug($"Generic exception occurred when accepting tracing payloads.");
                    _agentHealthReporter.ReportSupportabilityTraceContextAcceptException();
                    break;

                case IngestErrorType.TraceContextCreateException:
                    Log.Debug($"Generic exception occurred when creating tracing payloads.");
                    _agentHealthReporter.ReportSupportabilityTraceContextCreateException();
                    break;

                case IngestErrorType.TraceParentParseException:
                    Log.Debug($"The incoming traceparent header could not be parsed.");
                    _agentHealthReporter.ReportSupportabilityTraceContextTraceParentParseException();
                    break;

                case IngestErrorType.TraceStateParseException:
                    Log.Debug($"The incoming tracestate header could not be parsed.");
                    _agentHealthReporter.ReportSupportabilityTraceContextTraceStateParseException();
                    break;

                case IngestErrorType.TraceStateInvalidNrEntry:
                    Log.Debug($"The incoming tracestate header has an invalid New Relic entry.");
                    _agentHealthReporter.ReportSupportabilityTraceContextTraceStateInvalidNrEntry();
                    break;

                case IngestErrorType.TraceStateNoNrEntry:
                    Log.Debug($"The incoming tracestate header does not contain a trusted New Relic entry.");
                    _agentHealthReporter.ReportSupportabilityTraceContextTraceStateNoNrEntry();
                    break;

                default:
                    break;
                }
            }
        }