snowpark-python icon indicating copy to clipboard operation
snowpark-python copied to clipboard

SNOW-1462014: Ability to disable OTel span creation even if opentelemetry is installed

Open mikeldking opened this issue 1 year ago • 9 comments

What is the current behavior?

If opentelemetry is installed, spans are automatically emitted via https://github.com/snowflakedb/snowpark-python/blob/29b3bba9a7bd13206221b6fc6ad9ed0fae853fe0/src/snowflake/snowpark/_internal/open_telemetry.py

What is the desired behavior?

Add the ability to disable span creation even if opentelemetry is installed so as to keep the trace hierarchy simpler.

How would this improve snowflake-snowpark-python?

Make it more configurable and more composable with other OTel instrumentations

References, Other Background

OTel gives you the ability to turn off different instrumentations like so: https://github.com/snowflakedb/snowpark-python/blob/29b3bba9a7bd13206221b6fc6ad9ed0fae853fe0/src/snowflake/snowpark/_internal/open_telemetry.py

mikeldking avatar Jun 04 '24 14:06 mikeldking

Hi, do you just want to be able to disable all snowpark emit spans, or you also want to have control on what function should not emit span? For example, do you want snowpark to emit span on .collect() while not emitting span on .show() ?

sfc-gh-yuwang avatar Jun 04 '24 18:06 sfc-gh-yuwang

@sfc-gh-yuwang thanks so much for responding! For now I think it's an overall switch-off (@trevor-laviale-arize might be able to chime in here)

mikeldking avatar Jun 04 '24 19:06 mikeldking

Yeah I think just the ability to disable in general is good for now :)

trevorlaviale avatar Jun 04 '24 19:06 trevorlaviale

Got it, will do this recently, I am thinking about having a environment variable to turn on/off snowpark opentelemetry

sfc-gh-yuwang avatar Jun 04 '24 19:06 sfc-gh-yuwang

Amazing, thanks so much!

trevorlaviale avatar Jun 04 '24 19:06 trevorlaviale

Thanks @sfc-gh-yuwang - env var makes a ton of sense

mikeldking avatar Jun 04 '24 20:06 mikeldking

I want to do a quick update on this issue, we are now discussing with other teams who potentially could have the issue about a uniform solution across snowflake, we should have this solved within this month

sfc-gh-yuwang avatar Aug 06 '24 22:08 sfc-gh-yuwang

@mikeldking , @trevor-laviale-arize -- Have you tried setting this env var? OTEL_PYTHON_DISABLED_INSTRUMENTATIONS ?

https://opentelemetry.io/docs/zero-code/python/configuration/#disabling-specific-instrumentations

sfc-gh-jfreeberg avatar Aug 20 '24 18:08 sfc-gh-jfreeberg

I also find that opentelemetry has recently added a feature of trace config: https://github.com/open-telemetry/opentelemetry-specification/pull/3877 , can you also try it?

sfc-gh-yuwang avatar Aug 21 '24 00:08 sfc-gh-yuwang

Sorry very late to this request. This wasn't specifically for me but something observed by one of our customers. I believe the above would work and thus I will close my request. Thanks for the help

mikeldking avatar Jun 20 '25 04:06 mikeldking