Skip to content

Commit 32c6fb3

Browse files
committed
feat: remove unused code
1 parent 5eb8f2a commit 32c6fb3

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

veadk/tracing/telemetry/exporters/apmplus_exporter.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ def record_call_llm(
228228
attributes = {
229229
"gen_ai_system": "volcengine",
230230
"gen_ai_response_model": llm_request.model,
231-
"gen_ai_operation_name": "chat_completions",
231+
"gen_ai_operation_name": "chat",
232+
"gen_ai_operation_type": "llm",
232233
"stream": "false",
233234
"server_address": "api.volcengine.com",
234235
} # required by Volcengine APMPlus
@@ -313,19 +314,18 @@ def record_tool_call(
313314
span = trace.get_current_span()
314315
if not span:
315316
return
316-
operation = "tool"
317-
operation_type = tool.name
317+
operation_type = "tool"
318+
operation_name = tool.name
318319
operation_backend = ""
319320
if tool.custom_metadata:
320321
operation_backend = tool.custom_metadata.get("backend", "")
321-
# if random.randint(0, 1) == 0:
322-
# operation_type = "load_memory"
323-
# operation_backend = "mem0"
322+
324323
attributes = {
325-
"gen_ai_operation_name": operation,
324+
"gen_ai_operation_name": operation_name,
326325
"gen_ai_operation_type": operation_type,
327326
"gen_ai_operation_backend": operation_backend,
328327
}
328+
329329
if hasattr(span, "start_time") and self.apmplus_span_latency:
330330
# span 耗时
331331
duration = (time.time_ns() - span.start_time) / 1e9 # type: ignore
@@ -349,9 +349,6 @@ def record_tool_call(
349349
)
350350

351351

352-
353-
354-
355352
class APMPlusExporterConfig(BaseModel):
356353
endpoint: str = Field(
357354
default_factory=lambda: settings.apmplus_config.otel_exporter_endpoint,

0 commit comments

Comments
 (0)