opentelemetry-demo icon indicating copy to clipboard operation
opentelemetry-demo copied to clipboard

Cart-Service need more helpful log / status check

Open wph95 opened this issue 1 year ago • 3 comments

used wrong env OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, cart-service can't connect to OTLP but no error log

➜  charts git:(wph95/otel-demo) ✗ kc logs demo-cart-service-57f754d46f-hmj7m
Connecting to Redis: demo-redis:6379,ssl=false,allowAdmin=true,abortConnect=false
Successfully connected to Redis
Performing small test
Small test result: OK
Initialization completed
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://[::]:8080
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /usr/src/app
Connection failed. Disposing the object
Connection failed. Disposing the object
Connection to redis was retored successfully
Connection to redis was retored successfully
GetCartAsync called with userId=0685aee7-b2b7-47c3-893a-ae4b898138f0
AddItemAsync called with userId=0685aee7-b2b7-47c3-893a-ae4b898138f0, productId=1YMWWN1N4O, quantity=1
GetCartAsync called with userId=0685aee7-b2b7-47c3-893a-ae4b898138f0

used right env OTEL_EXPORTER_OTLP_ENDPOINT, connect to OTLP

➜  charts git:(wph95/otel-demo) ✗ kc logs demo-cart-service-57f754d46f-hmj7m
Connecting to Redis: demo-redis:6379,ssl=false,allowAdmin=true,abortConnect=false
Successfully connected to Redis
Performing small test
Small test result: OK
Initialization completed
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://[::]:8080
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /usr/src/app
Connection failed. Disposing the object
Connection failed. Disposing the object
Connection to redis was retored successfully
Connection to redis was retored successfully
GetCartAsync called with userId=0685aee7-b2b7-47c3-893a-ae4b898138f0
AddItemAsync called with userId=0685aee7-b2b7-47c3-893a-ae4b898138f0, productId=1YMWWN1N4O, quantity=1
GetCartAsync called with userId=0685aee7-b2b7-47c3-893a-ae4b898138f0


wph95 avatar Jul 21 '22 21:07 wph95

might improve LogLevel ?

wph95 avatar Jul 21 '22 21:07 wph95

@mic-max could you potentially take a look when youre back?

cartersocha avatar Jul 22 '22 00:07 cartersocha

Logging is done with plain Console log statements. It should be using the Logging API. I can make a small PR attempt...

cijothomas avatar Sep 29 '22 22:09 cijothomas

I have replaced the Console log statements as opentelemetry log API.

yuxiaoba avatar Nov 10 '22 06:11 yuxiaoba

This will be addressed in future logging work - closing for now.

austinlparker avatar Feb 06 '23 16:02 austinlparker