Skip to content

Commit 828aba2

Browse files
committed
fix
1 parent 80025aa commit 828aba2

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

cozeloop/internal/consts/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
THREAD_ID = "thread_id"
4040
START_TIME_FIRST_RESP = "start_time_first_resp"
4141
LATENCY_FIRST_RESP = "latency_first_resp"
42+
DEPLOYMENT_ENV = "deployment_env"
4243
CUT_OFF = "cut_off"
4344

4445
# ReserveFieldTypes Define the allowed types for each reserved field.

cozeloop/internal/trace/noop_span.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ def set_log_id(self, log_id: str) -> None:
119119
def set_system_tags(self, system_tags: Dict[str, Any]) -> None:
120120
pass
121121

122+
def set_deployment_env(self, deployment_env: str) -> None:
123+
pass
124+
122125
def __enter__(self):
123126
return self
124127

cozeloop/internal/trace/span.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,9 @@ def set_system_tags(self, system_tags: Dict[str, Any]) -> None:
383383
for key, value in system_tags.items():
384384
self.system_tag_map[key] = value
385385

386+
def set_deployment_env(self, deployment_env: str) -> None:
387+
self.set_tags({DEPLOYMENT_ENV: deployment_env})
388+
386389
def get_rectified_map(self, input_map: Dict[str, Any]) -> (Dict[str, Any], List[str], int):
387390
validate_map = {}
388391
cut_off_keys = []

cozeloop/span.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ def set_system_tags(self, system_tags: Dict[str, Any]) -> None:
186186
Set system tags. DO NOT use this method unless you know what you are doing.
187187
"""
188188

189+
def set_deployment_env(self, deployment_env: str) -> None:
190+
"""
191+
Set the deployment environment of the span, identify custom environments.
192+
"""
193+
189194

190195
class Span(CommonSpanSetter, SpanContext):
191196
"""

0 commit comments

Comments
 (0)