You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@flagon.apache.org by "brucearctor (via GitHub)" <gi...@apache.org> on 2026/07/14 01:22:49 UTC

[I] feat(export): OTLP/JSON exporter for OpenTelemetry integration (flagon)

brucearctor opened a new issue, #140:
URL: https://github.com/apache/flagon/issues/140

   ## 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 `LogRecord` attributes 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
   
   ```javascript
   // One config change to enable OTLP
   userale.start({
     exporterType: 'otlp',
     otlpEndpoint: 'http://localhost:4318',
   });
   ```
   
   ## Depends On
   
   - #139 (LogExporter interface)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For additional commands, e-mail: notifications-help@flagon.apache.org


Re: [I] feat(export): OTLP/JSON exporter for OpenTelemetry integration (flagon)

Posted by "brucearctor (via GitHub)" <gi...@apache.org>.
brucearctor closed issue #140: feat(export): OTLP/JSON exporter for OpenTelemetry integration
URL: https://github.com/apache/flagon/issues/140


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For additional commands, e-mail: notifications-help@flagon.apache.org