mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-23 08:55:44 +08:00
refactor: remove beta diagnostics collection and reporting (#2616)
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ..telemetry import diagnostics
|
||||
|
||||
from typing import Any, Union
|
||||
import json
|
||||
import time
|
||||
@@ -303,8 +301,6 @@ async def _validate_agent_run_session(
|
||||
)
|
||||
if not available_apis.get(api_capability, False) and not has_admin_permission:
|
||||
return None, handler.ActionResponse.error(message=f'{api_name} access not authorized')
|
||||
|
||||
diagnostics.link_context(session.get('_diagnostic_context'))
|
||||
return session, None
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# For connect to plugin runtime.
|
||||
from __future__ import annotations
|
||||
|
||||
from langbot.pkg.telemetry import diagnostics
|
||||
|
||||
import asyncio
|
||||
import contextlib
|
||||
import contextvars
|
||||
@@ -720,7 +718,6 @@ class PluginRuntimeConnector(ManagedRuntimeConnector):
|
||||
}
|
||||
)
|
||||
|
||||
@diagnostics.observe('lifecycle', 'runtime.prepare_connected_runtime', source='runtime', stage='execute')
|
||||
async def _prepare_connected_runtime(self) -> None:
|
||||
"""Handshake follow-up: pin OSS compatibility, then replay authority."""
|
||||
|
||||
@@ -906,7 +903,6 @@ class PluginRuntimeConnector(ManagedRuntimeConnector):
|
||||
self.schedule_reconnect()
|
||||
failures = 0
|
||||
|
||||
@diagnostics.observe('lifecycle', 'runtime.initialize', source='runtime', stage='execute')
|
||||
async def initialize(self):
|
||||
if not self.is_enable_plugin:
|
||||
self.ap.logger.info('Plugin system is disabled.')
|
||||
@@ -1817,7 +1813,6 @@ class PluginRuntimeConnector(ManagedRuntimeConnector):
|
||||
}
|
||||
return {**install_info, '_certification': certification_info}, verified
|
||||
|
||||
@diagnostics.observe('lifecycle', 'runtime.install_plugin', source='runtime', stage='execute')
|
||||
async def install_plugin(
|
||||
self,
|
||||
install_source: PluginInstallSource,
|
||||
@@ -1984,7 +1979,6 @@ class PluginRuntimeConnector(ManagedRuntimeConnector):
|
||||
task_context.set_current_action('plugin updated' if operation == 'upgrade' else 'plugin installed')
|
||||
task_context.metadata['progress_percent'] = 100
|
||||
|
||||
@diagnostics.observe('lifecycle', 'runtime.upgrade_plugin', source='runtime', stage='execute')
|
||||
async def upgrade_plugin(
|
||||
self,
|
||||
plugin_author: str,
|
||||
@@ -2011,7 +2005,6 @@ class PluginRuntimeConnector(ManagedRuntimeConnector):
|
||||
)
|
||||
return {}
|
||||
|
||||
@diagnostics.observe('lifecycle', 'runtime.delete_plugin', source='runtime', stage='execute')
|
||||
async def delete_plugin(
|
||||
self,
|
||||
plugin_author: str,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from ..telemetry import diagnostics
|
||||
|
||||
import asyncio
|
||||
import inspect
|
||||
import typing
|
||||
@@ -646,8 +644,6 @@ class RuntimeConnectionHandler(handler.Handler):
|
||||
payload fields can never select the scope. A transaction-free boundary
|
||||
avoids reserving one pooled connection across provider and network waits.
|
||||
"""
|
||||
|
||||
diagnostics.annotate(workspace_uuid=action_context.workspace_uuid)
|
||||
persistence_mgr = getattr(self.ap, 'persistence_mgr', None)
|
||||
if persistence_mgr is None:
|
||||
yield
|
||||
@@ -700,9 +696,7 @@ class RuntimeConnectionHandler(handler.Handler):
|
||||
async for response in responses:
|
||||
yield response
|
||||
|
||||
self.actions[action_name] = diagnostics.observe(
|
||||
'api', 'host.' + action_name, source='plugin', ap=self.ap
|
||||
)(secured_stream_action)
|
||||
self.actions[action_name] = secured_stream_action
|
||||
continue
|
||||
|
||||
async def secured_action(
|
||||
@@ -731,9 +725,7 @@ class RuntimeConnectionHandler(handler.Handler):
|
||||
response = await response
|
||||
return response
|
||||
|
||||
self.actions[action_name] = diagnostics.observe('api', 'host.' + action_name, source='plugin', ap=self.ap)(
|
||||
secured_action
|
||||
)
|
||||
self.actions[action_name] = secured_action
|
||||
|
||||
async def _get_plugin_setting(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user