CSDK Query Threshold giving lot of other statements on cloudwatch which

I am implementing query threshold logging to print queries which are taking longer time than threshold. I am getting below information on info level logging.

74150995ms [I61c6be5514c7e32b] {7} [WARN] (lcbio_mgr - L:483) <10.132.72.84:8093> (HE=0x7f2d4c0a5d00) Pooled socket is dead. Continuing to next one
74150995ms [I61c6be5514c7e32b] {7} [INFO] (connection - L:497) <10.132.72.84:8093> (SOCK=b14a1072d2a4839a) Starting. Timeout=75000000us
74150995ms [I61c6be5514c7e32b] {7} [INFO] (connection - L:159) <10.132.72.84:8093> (SOCK=b14a1072d2a4839a) Connected established
74151000ms [I669bcec83817e842] {7} [WARN] (lcbio_mgr - L:483) <10.132.72.94:8093> (HE=0x7f2d4c107250) Pooled socket is dead. Continuing to next one
74151000ms [I669bcec83817e842] {7} [INFO] (connection - L:497) <10.132.72.94:8093> (SOCK=7b162963332eeeee) Starting. Timeout=75000000us

30**9463ms [I664201bdca342ead] {7} [INFO] (tracer - L:175) Operations over threshold: **
****{ "count": 1, “service”: “query”, “top”: [ { “last_dispatch_duration_us”: 7425, “last_local_socket”: “172.17.0.10:49878”, “last_operation_id”: “73a1ecd533a7cc65”, “last_remote_socket”: “10.132.72.72:8093”, “operation_name”: “query”, “total_dispatch_duration_us”: 7425, “total_duration_us”: 7425 } ] }

74151000ms [I669bcec83817e842] {7} [INFO] (connection - L:159) <10.132.72.94:8093> (SOCK=7b162963332eeeee) Connected established
74151015ms [I2056933d3839dd62] {7} [WARN] (lcbio_mgr - L:483) <10.132.72.94:8093> (HE=0x7f2d4c0e3290) Pooled socket is dead. Continuing to next one
74151015ms [I2056933d3839dd62] {7} [INFO] (connection - L:497) <10.132.72.94:8093> (SOCK=53328e290c6fd72e) Starting. Timeout=75000000us
74151015ms [I2056933d3839dd62] {7} [INFO] (connection - L:159) <10.132.72.94:8093> (SOCK=53328e290c6fd72e) Connected established
74151017ms [I669bcec83817e842] {7} [INFO] (connection - L:497) <10.132.72.79:8093> (SOCK=ee254c96a91e90fd) Starting. Timeout=75000000us
74151018ms [I669bcec83817e842] {7} [INFO] (connection - L:159) <10.132.72.79:8093> (SOCK=ee254c96a91e90fd) Connected established
74151020ms [I61c6be5514c7e32b] {7} [INFO] (connection - L:497) <10.132.72.89:8093> (SOCK=192ba357f65db3fb) Starting. Timeout=75000000us
74151020ms [I61c6be5514c7e32b] {7} [INFO] (connection - L:159) <10.132.72.89:8093> (SOCK=192ba357f65db3fb) Connected established

What if I just want to print only query related infomation:

*****9463ms [I664201bdca342ead] {7} [INFO] (tracer - L:175) Operations over threshold: ***
****{ "count": 1, “service”: “query”, “top”: [ { “last_dispatch_duration_us”: 7425, “last_local_socket”: “172.17.0.10:49878”, “last_operation_id”: “73a1ecd533a7cc65”, “last_remote_socket”: “10.132.72.72:8093”, “operation_name”: “query”, “total_dispatch_duration_us”: 7425, “total_duration_us”: 7425 } ] }

And also actual query is printing on trace level logging (on trace level I am getting more info which we dont required) is it possible to print actual query in info level logging?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

It looks like you are using the logging from the default Request Tracer.

Here is the logging documentation for the C SDK - Collecting Information and Logging in the C (libcouchbase) SDK | Couchbase Docs

The “Pooled Socket is dead”, “Starting”, “Connection established” messages are not from the threshold logging. They will appear (at INFO logging level) independent of threshold logging.

The logging levels of messages are chosen by what would seem reasonable to most users. Logging every query at INFO would quickly clutter up logs for applications doing thousands of queries per second. Not logging Connection information at INFO (ie. instead logging at DEBUG or TRACE) would mean generating many more messages just to see the connection information.

Instead of relying on the default/provided Threshold Logger, you can create your own and use it with OpenTelemetry.