@@ -660,6 +660,7 @@ def fetch_traces(
660660 session_id : Optional [str ] = None ,
661661 from_timestamp : Optional [dt .datetime ] = None ,
662662 to_timestamp : Optional [dt .datetime ] = None ,
663+ environment : Optional [Union [str , Sequence [str ]]] = None ,
663664 order_by : Optional [str ] = None ,
664665 tags : Optional [Union [str , Sequence [str ]]] = None ,
665666 ) -> FetchTracesResponse :
@@ -673,6 +674,7 @@ def fetch_traces(
673674 session_id (Optional[str]): Filter by session_id. Defaults to None.
674675 from_timestamp (Optional[dt.datetime]): Retrieve only traces with a timestamp on or after this datetime. Defaults to None.
675676 to_timestamp (Optional[dt.datetime]): Retrieve only traces with a timestamp before this datetime. Defaults to None.
677+ environment (Optional[Union[str, Sequence[str]]]): Filter by environment. Defaults to None.
676678 order_by (Optional[str]): Format of the string `[field].[asc/desc]`. Fields: id, timestamp, name, userId, release, version, public, bookmarked, sessionId. Example: `timestamp.asc`. Defaults to None.
677679 tags (Optional[Union[str, Sequence[str]]]): Filter by tags. Defaults to None.
678680
@@ -684,7 +686,7 @@ def fetch_traces(
684686 """
685687 try :
686688 self .log .debug (
687- f"Getting traces... { page } , { limit } , { name } , { user_id } , { session_id } , { from_timestamp } , { to_timestamp } , { order_by } , { tags } "
689+ f"Getting traces... { page } , { limit } , { name } , { user_id } , { session_id } , { from_timestamp } , { to_timestamp } , { environment } , { order_by } , { tags } "
688690 )
689691 res = self .client .trace .list (
690692 page = page ,
@@ -694,6 +696,7 @@ def fetch_traces(
694696 session_id = session_id ,
695697 from_timestamp = from_timestamp ,
696698 to_timestamp = to_timestamp ,
699+ environment = environment ,
697700 order_by = order_by ,
698701 tags = tags ,
699702 )
@@ -768,6 +771,7 @@ def fetch_observations(
768771 parent_observation_id : typing .Optional [str ] = None ,
769772 from_start_time : typing .Optional [dt .datetime ] = None ,
770773 to_start_time : typing .Optional [dt .datetime ] = None ,
774+ environment : Optional [Union [str , Sequence [str ]]] = None ,
771775 type : typing .Optional [str ] = None ,
772776 ) -> FetchObservationsResponse :
773777 """Get a list of observations in the current project matching the given parameters.
@@ -781,6 +785,7 @@ def fetch_observations(
781785 parent_observation_id (Optional[str]): Parent observation identifier. Defaults to None.
782786 from_start_time (Optional[dt.datetime]): Retrieve only observations with a start_time on or after this datetime. Defaults to None.
783787 to_start_time (Optional[dt.datetime]): Retrieve only observations with a start_time before this datetime. Defaults to None.
788+ environment (Optional[Union[str, Sequence[str]]]): Filter by environment. Defaults to None.
784789 type (Optional[str]): Type of the observation. Defaults to None.
785790
786791 Returns:
@@ -791,7 +796,7 @@ def fetch_observations(
791796 """
792797 try :
793798 self .log .debug (
794- f"Getting observations... { page } , { limit } , { name } , { user_id } , { trace_id } , { parent_observation_id } , { from_start_time } , { to_start_time } , { type } "
799+ f"Getting observations... { page } , { limit } , { name } , { user_id } , { trace_id } , { parent_observation_id } , { from_start_time } , { to_start_time } , { environment } , { type } "
795800 )
796801 res = self .client .observations .get_many (
797802 page = page ,
@@ -802,6 +807,7 @@ def fetch_observations(
802807 parent_observation_id = parent_observation_id ,
803808 from_start_time = from_start_time ,
804809 to_start_time = to_start_time ,
810+ environment = environment ,
805811 type = type ,
806812 )
807813 return FetchObservationsResponse (data = res .data , meta = res .meta )
0 commit comments