feat(export): OTLP/JSON exporter for OpenTelemetry integration
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- observability
Research direction
Start with the LogExporter interface from #139 and the userale.start configuration entry point shown in the issue. Trace how exporterType and otlpEndpoint are handled, then implement the documented Flagon-to-OTLP mappings and verify that logs reach the standard /v1/logs endpoint with the specified JSON structure.
Written by the indexing model from the issue text.
Description
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)
- Dominant language
- Jupyter Notebook
- Stars
- 30
- Forks
- 15
- Avg merge
- 7d 11h
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/flagon
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
process
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Discuss enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
enhancement experimental
Difficulty 5/5 Over a week Newbie friendliness 42/100
-
enhancement Userale
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Similar issues
-
bug(sight): interruption count/stats accept filters they silently ignorePossibly taken @unbridled-41 claimed this today. Opencomponent:sight
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
agentic-os-org/ANOLISA#6091 · 1 comment ·
Maintainers usually reply within 1 day
-
bug needs triage pkg/translator/faro
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open-telemetry/opentelemetry-collector-contrib#51759 · 1 comment ·
Maintainers usually reply within 1 day
-
area/dashboard QA/dev-automation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
rancher/dashboard#19371 · 1 comment ·
Maintainers usually reply within 5 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/skywalking#14120 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Altinity/clickhouse-operator#2093 ·
Maintainers usually reply within 2 days