微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

AmazonCloudWatchLogsException 向 https://logs.ap-southeast-x.amazonaws.com/

如何解决AmazonCloudWatchLogsException 向 https://logs.ap-southeast-x.amazonaws.com/

我正在尝试将 aws x-ray 用于我的微服务 asp.net 核心应用程序,以进行性能评估和日志记录。

对于日志记录,我使用下面的 RegisterLogger 和 loggingOption 作为控制台。在启动控制器中添加了以下更改。 AWSXRayRecorder.RegisterLogger(LoggingOptions.Console);

在启动时在 ConfigureServices 类中添加了 AWSXRayRecorder.InitializeInstance(Configuration)

在启动时的配置类中添加了 app.UseXRay("XRayService",Configuration)。

也在 appsettting.json 文件中的配置下方。

“X 射线”:{ "disableXRayTracing": "false","AWSXRayPlugins": "EC2Plugin","UseRuntimeErrors": "true" }

我在 127.0.0.1:2000 中运行带有守护程序的 dotnet 核心应用程序,但我没有在 X 射线控制台中收到日志信息、警告或错误

出现以下错误: AmazonCloudWatchLogsException 向 https://logs.ap-southeast-xx.amazonaws.com/

发出请求 DescribeLogGroupsRequest

完整的控制台消息:

IPEndPointExtension 1|2021-06-08T18:17:45.104Z|DEBUG|Determined that 127.0.0.1:2000 is an IP.
IPEndPointExtension 2|2021-06-08T18:17:45.119Z|INFO|Using custom daemon address for UDP and TCP: 127.0.0.1:2000
DefaultExceptionSerializationStrategy 3|2021-06-08T18:17:45.123Z|DEBUG|Setting max stack frame size : 50
LocalizedSamplingStrategy 4|2021-06-08T18:17:45.137Z|DEBUG|Initializing with custom sampling configuration : sampling-rules.json
EC2Plugin 5|2021-06-08T18:17:45.314Z|DEBUG|Failed to get token for Imdsv2
EC2Plugin 6|2021-06-08T18:17:45.316Z|DEBUG|Error occurred while getting EC2 Metadata
EC2Plugin 7|2021-06-08T18:17:45.316Z|DEBUG|Could not get instance Metadata
AWSXRayRecorderImpl 8|2021-06-08T18:17:45.318Z|DEBUG|Context missing mode : RUNTIME_ERROR
AWSXRayRecorderImpl 9|2021-06-08T18:17:45.318Z|DEBUG|AWS_XRAY_CONTEXT_MISSING environment variable is set to LOG_ERROR. Override local value.
IPEndPointExtension 10|2021-06-08T18:17:45.319Z|DEBUG|Determined that 127.0.0.1:2000 is an IP.
IPEndPointExtension 11|2021-06-08T18:17:45.319Z|INFO|Using custom daemon address for UDP and TCP: 127.0.0.1:2000
DefaultExceptionSerializationStrategy 12|2021-06-08T18:17:45.320Z|DEBUG|Setting max stack frame size : 50
AWSXRayRecorderImpl 13|2021-06-08T18:17:45.322Z|DEBUG|Context missing mode : RUNTIME_ERROR
AWSXRayRecorderImpl 14|2021-06-08T18:17:45.322Z|DEBUG|AWS_XRAY_CONTEXT_MISSING environment variable is set to LOG_ERROR. Override local value.
ProfileInternalConfiguration 15|2021-06-08T18:17:45.515Z|INFO|endpoint_discovery_enabled found in profile 'default' in store Amazon.Runtime.CredentialManagement.CredentialProfileStoreChain
ProfileInternalConfiguration 16|2021-06-08T18:17:45.515Z|INFO|There is no retry_mode set in the profile named 'default' in store Amazon.Runtime.CredentialManagement.CredentialProfileStoreChain
ProfileInternalConfiguration 17|2021-06-08T18:17:45.516Z|INFO|There is no max_attempts set in the profile named 'default' in store Amazon.Runtime.CredentialManagement.CredentialProfileStoreChain
RuntimePipelineCustomizerRegistry 18|2021-06-08T18:17:45.784Z|INFO|Registering runtime pipeline customizer X-Ray Registration Customization
IPEndPointExtension 19|2021-06-08T18:17:46.302Z|DEBUG|Determined that 127.0.0.1:2000 is an IP.
IPEndPointExtension 20|2021-06-08T18:17:46.302Z|INFO|Using custom daemon address for UDP and TCP: 127.0.0.1:2000
DefaultExceptionSerializationStrategy 21|2021-06-08T18:17:46.303Z|DEBUG|Setting max stack frame size : 50
LocalizedSamplingStrategy 22|2021-06-08T18:17:46.304Z|DEBUG|Initializing with custom sampling configuration : sampling-rules.json
EC2Plugin 23|2021-06-08T18:17:46.311Z|DEBUG|Failed to get token for Imdsv2
EC2Plugin 24|2021-06-08T18:17:46.312Z|DEBUG|Error occurred while getting EC2 Metadata
EC2Plugin 25|2021-06-08T18:17:46.312Z|DEBUG|Could not get instance Metadata
AWSXRayRecorderImpl 26|2021-06-08T18:17:46.313Z|DEBUG|Context missing mode : RUNTIME_ERROR
AWSXRayRecorderImpl 27|2021-06-08T18:17:46.313Z|DEBUG|AWS_XRAY_CONTEXT_MISSING environment variable is set to LOG_ERROR. Override local value.
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path:Sell.Service
AmazonCloudWatchLogsClient 28|2021-06-08T18:17:47.064Z|ERROR|An exception of type HttpErrorResponseException was handled in ErrorHandler. --> Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown.
   at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken)
   at Amazon.Runtime.Internal.HttpHandler`1.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.Unmarshaller.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)
AmazonCloudWatchLogsClient 29|2021-06-08T18:17:47.104Z|INFO|AmazonCloudWatchLogsException making request DescribeLogGroupsRequest to https://logs.ap-southeast-2.amazonaws.com/. Attempting retry 1 of 3
 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。