feat: add edition field to telemetry payload

Sends constants.edition (community/saas) with each telemetry event
so Space can distinguish between community and SaaS instances.
This commit is contained in:
RockChinQ
2026-04-08 20:28:22 +08:00
parent b894842736
commit af3f557055
2 changed files with 2 additions and 1 deletions

View File

@@ -208,6 +208,7 @@ class ChatMessageHandler(handler.MessageHandler):
'model_name': model_name, 'model_name': model_name,
'version': constants.semantic_version, 'version': constants.semantic_version,
'instance_id': constants.instance_id, 'instance_id': constants.instance_id,
'edition': constants.edition,
'pipeline_plugins': pipeline_plugins, 'pipeline_plugins': pipeline_plugins,
'error': locals().get('error_info', None), 'error': locals().get('error_info', None),
'timestamp': datetime.utcnow().isoformat(), 'timestamp': datetime.utcnow().isoformat(),

View File

@@ -60,7 +60,7 @@ class TelemetryManager:
except Exception: except Exception:
sanitized['query_id'] = str(sanitized.get('query_id', '')) sanitized['query_id'] = str(sanitized.get('query_id', ''))
for sfield in ('adapter', 'runner', 'runner_category', 'model_name', 'version', 'error', 'timestamp'): for sfield in ('adapter', 'runner', 'runner_category', 'model_name', 'version', 'edition', 'error', 'timestamp'):
v = sanitized.get(sfield) v = sanitized.get(sfield)
sanitized[sfield] = '' if v is None else str(v) sanitized[sfield] = '' if v is None else str(v)