feat(export): OTLP/JSON exporter for OpenTelemetry integration
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- javascript
调研方向
从 #139 中的 LogExporter 接口以及 issue 中所示的 userale.start 配置入口开始。跟踪 exporterType 和 otlpEndpoint 的处理方式,然后实现文档中规定的 Flagon-to-OTLP 映射,并验证日志是否以指定的 JSON 结构到达标准 /v1/logs 端点。
由索引模型根据 Issue 内容生成。
描述
Summary
Implement an OtlpJsonExporter that sends UserALE logs to any OpenTelemetry Collector via OTLP/HTTP JSON.
Motivation
OpenTelemetry is the de-facto standard for observability. OTLP support lets Flagon users send behavioral data to Grafana, Datadog, Jaeger, and any OTel-compatible backend — without building custom ingestion pipelines.
No competing behavioral analytics library (PostHog, Matomo, Plausible) speaks OTLP. This is a differentiation opportunity.
Design
- Maps Flagon log fields → OTLP
LogRecordattributes using OTel semantic conventions - Builds OTLP/JSON payloads using plain objects (zero external dependencies)
- Ships to standard OTLP HTTP receiver (port 4318,
/v1/logs) - ~150 lines of code, ~2-3 KB gzipped added to bundle
Attribute Mapping
| Flagon Field | OTLP Mapping |
|---|---|
clientTime |
timeUnixNano |
toolName |
resource.service.name |
useraleVersion |
resource.telemetry.sdk.version |
userId |
attributes.enduser.id |
sessionId |
attributes.session.id |
pageUrl |
attributes.url.full |
target |
attributes.flagon.dom.target |
type |
attributes.flagon.event_type |
logType |
attributes.flagon.log_type |
details |
body (JSON string) |
User Experience
// One config change to enable OTLP
userale.start({
exporterType: 'otlp',
otlpEndpoint: 'http://localhost:4318',
});
Depends On
- #139 (LogExporter interface)
- 主要语言
- Jupyter Notebook
- 星标
- 30
- 派生
- 15
- 平均合并
- 1 小时 4 分钟
- 30 天内合并 PR
- 27
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/flagon 的其他 Issue
-
process
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
-
Discuss enhancement
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
-
Userale
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
-
CI/CD enhancement
难度 3/5 1-2 天 新手友好度 45/100
维护者通常 1 天内回复
-
process
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
SigNoz/dashboards#429 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 80/100
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
area: frontend bug priority: low
难度 2/5 1-3 小时 新手友好度 85/100
snapotter-hq/SnapOtter#4106 ·
维护者通常 1 天内回复