用途:为 Frappe 应用提供 OpenObserve 日志与可观测性集成的专家指导,适用于创建、配置或排查 OpenObserve API DocType,以及实现日志发送与搜索。
主要能力:配置单一 DocType「Open Observe API」,含 URL、user、password、default organization 字段;核心函数 send_logs()、search_logs()、test_connection();支持批量日志发送、基于时间的搜索(ISO 时间戳自动转换为 Unix 微秒)、SQL 查询与 JSON 过滤器、dry run 测试、密码加密存储。OpenObserve 为开源可观测性平台,涵盖日志、指标与追踪;Stream 为日志命名通道(如 application-logs、error-logs),Organization 用于环境隔离,默认使用配置的 default_org。
使用方式:仅 System Manager 可访问;在 Server Scripts 或业务逻辑中可通过 Safe Exec 全局对象 open_observe.send_logs() 与 open_observe.search_logs() 直接调用,无需导入;也可通过 frappe.call 调用 send_logs。时间戳使用 _timestamp 或 @timestamp 字段(Unix 微秒),Frappe datetime 无时区,需用 frappe.utils.convert_timezone_to_utc() 保证准确。
适用场景:Frappe 应用日志采集与分析、按时间范围检索日志、事件与用户行为追踪。
限制:需 System Manager 权限;HTTP Basic Auth 经 base64 编码,30 秒超时;错误写入 Frappe Error Log。未提供定价、平台与完整 API 参数信息。详细函数文档、示例与排查见 references/api-reference.md、references/examples.md、references/troubleshooting.md。