Exemplo n.º 1
0
 private void LogConfigurationSettings()
 {
     LogMessage(LogLevel.Info, $"Configuration Setting - Host - {EndpointHost}");
     LogMessage(LogLevel.Info, $"Configuration Setting - Port - {EndpointPort}");
     LogMessage(LogLevel.Finest, $"Configuration Setting - SSL - {EndpointSsl}");
     LogMessage(LogLevel.Info, $"Configuration Setting - Consumers - {_configuration.InfiniteTracingTraceCountConsumers}");
     LogMessage(LogLevel.Finest, $"Configuration Setting - Test Flaky - {EndpointTestFlaky?.ToString() ?? "NULL"}");
     LogMessage(LogLevel.Finest, $"Configuration Setting - Test Flaky Code - {EndpointTestFlakyCode?.ToString() ?? "NULL"}");
     LogMessage(LogLevel.Finest, $"Configuration Setting - Test Delay (ms) - {EndpointTestDelayMs?.ToString() ?? "NULL"}");
 }
Exemplo n.º 2
0
        private Metadata CreateMetadataHeaders()
        {
            var headers = new Metadata();

            headers.Add(new Metadata.Entry("agent_run_token", _configuration.AgentRunId.ToString()));
            headers.Add(new Metadata.Entry("license_key", _configuration.AgentLicenseKey));

            if (_configuration.RequestHeadersMap != null)
            {
                foreach (var requestHeader in _configuration.RequestHeadersMap)
                {
                    headers.Add(new Metadata.Entry(requestHeader.Key.ToLower(), requestHeader.Value));
                }
            }

            if (EndpointTestDelayMs.HasValue)
            {
                headers.Add(new Metadata.Entry("delay", EndpointTestDelayMs.ToString()));
            }

            if (EndpointTestFlaky.HasValue)
            {
                headers.Add(new Metadata.Entry("flaky", EndpointTestFlaky.ToString()));
            }

            if (EndpointTestFlakyCode.HasValue)
            {
                headers.Add(new Metadata.Entry("flaky_code", EndpointTestFlakyCode.ToString()));
            }

            if (Log.IsFinestEnabled)
            {
                var parametersString = string.Join(",", headers.Select(x => $"{x.Key}={x.Value}"));
                LogMessage(LogLevel.Finest, $"Creating gRPC Metadata ({parametersString})");
            }

            return(headers);
        }