snowflake-connector-python icon indicating copy to clipboard operation
snowflake-connector-python copied to clipboard

SNOW-1177361: opentelemetry autoinstrumentation

Open drobert opened this issue 2 years ago • 3 comments

What is the current behavior?

None, seemingly. Using opentelemetry autoinstrumentation along with included related packages (see https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation ) a python application can get tracing data and timing for most network-related actions: http requests, database access, aws operations, etc. but snowflake is invisible.

What is the desired behavior?

Provide common database opentelemetry information if there's an active trace such that the query and timing (and calls) appear in auto-instrumented opentelemetry traces.

Barring that, documentation on how to manually collect trace information for snowflake-connector while otherwise utilizing automatic instrumentation would be helpful.

How would this improve snowflake-connector-python?

Improved observability of any python application utilizing snowflake

References and other background

No response

drobert avatar Feb 29 '24 18:02 drobert

hi and thank you for raising this request with us ! can you please take a look at the Emitting Trace Events in Python to see if it is at least partially what can help you move forward ?

sfc-gh-dszmolka avatar Mar 11 '24 12:03 sfc-gh-dszmolka

hi and thank you for raising this request with us ! can you please take a look at the Emitting Trace Events in Python to see if it is at least partially what can help you move forward ?

I did not feel this documentation was very helpful for this issue for two main reasons:

  1. this ticket is about automatic instrumentation. I had to do zero work to get queries traces in my existing application against my relational datastore (and other remote sources, see the instrumentation link in the issue description); the request here is to support the automatic instrumentation of an app which is successfully using auto-instrumentation for the rest of its trace collection.
  2. this is in the 'functions and procedures' section of the documentation. my application is running outside of snowflake but connecting to it using the python-connector. The documentation very heavily implies this is for python code running inside snowflake ( as a function/UDF )

drobert avatar Mar 12 '24 17:03 drobert

thanks for checking still, and for providing further insight into the use-case. we'll consider this requirement for enhancement for the future.

sfc-gh-dszmolka avatar Mar 13 '24 08:03 sfc-gh-dszmolka