File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
vertexai/agent_engines/templates Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -608,10 +608,10 @@ def test_span_content_capture_disabled_by_default(self):
608608 @mock .patch .dict (
609609 os .environ , {"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT" : "true" }
610610 )
611- def test_span_content_capture_enabled_with_env_var (self ):
611+ def test_span_content_capture_disabled_with_env_var (self ):
612612 app = agent_engines .AdkApp (agent = _TEST_AGENT )
613613 app .set_up ()
614- assert os .environ ["ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS" ] == "true "
614+ assert os .environ ["ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS" ] == "false "
615615
616616 @mock .patch .dict (os .environ )
617617 def test_span_content_capture_enabled_with_tracing (self ):
Original file line number Diff line number Diff line change @@ -641,14 +641,10 @@ def set_up(self):
641641 location = self ._tmpl_attrs .get ("location" )
642642 os .environ ["GOOGLE_CLOUD_LOCATION" ] = location
643643
644- content_enabled = os .getenv (
645- "OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT" , "false"
646- ).lower () in ("true" , "1" )
647- # Disable content capture in custom ADK spans unless:
648- # 1. User opted-in for content capture.
649- # 2. Or user enabled tracing explicitly with the old flag (this is to
650- # preserve compatibility with old behavior).
651- if self ._tmpl_attrs .get ("enable_tracing" ) or content_enabled :
644+ # Disable content capture in custom ADK spans unless user enabled
645+ # tracing explicitly with the old flag
646+ # (this is to preserve compatibility with old behavior).
647+ if self ._tmpl_attrs .get ("enable_tracing" ):
652648 os .environ ["ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS" ] = "true"
653649 else :
654650 os .environ ["ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS" ] = "false"
You can’t perform that action at this time.
0 commit comments