File tree Expand file tree Collapse file tree
vertexai/agent_engines/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -590,10 +590,10 @@ def test_span_content_capture_disabled_by_default(self):
590590 @mock .patch .dict (
591591 os .environ , {"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT" : "true" }
592592 )
593- def test_span_content_capture_enabled_with_env_var (self ):
593+ def test_span_content_capture_disabled_with_env_var (self ):
594594 app = agent_engines .AdkApp (agent = _TEST_AGENT )
595595 app .set_up ()
596- assert os .environ ["ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS" ] == "true "
596+ assert os .environ ["ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS" ] == "false "
597597
598598 @mock .patch .dict (os .environ )
599599 def test_span_content_capture_enabled_with_tracing (self ):
Original file line number Diff line number Diff line change @@ -634,14 +634,10 @@ def set_up(self):
634634 location = self ._tmpl_attrs .get ("location" )
635635 os .environ ["GOOGLE_CLOUD_LOCATION" ] = location
636636
637- content_enabled = os .getenv (
638- "OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT" , "false"
639- ).lower () in ("true" , "1" )
640- # Disable content capture in custom ADK spans unless:
641- # 1. User opted-in for content capture.
642- # 2. Or user enabled tracing explicitly with the old flag (this is to
643- # preserve compatibility with old behavior).
644- if self ._tmpl_attrs .get ("enable_tracing" ) or content_enabled :
637+ # Disable content capture in custom ADK spans unless user enabled
638+ # tracing explicitly with the old flag
639+ # (this is to preserve compatibility with old behavior).
640+ if self ._tmpl_attrs .get ("enable_tracing" ):
645641 os .environ ["ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS" ] = "true"
646642 else :
647643 os .environ ["ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS" ] = "false"
You can’t perform that action at this time.
0 commit comments