feat(export): introduce LogExporter interface
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- api
Research direction
Start by reading src/sendLogs.ts and tracing its current batch, transport, and authentication responsibilities. Review the proposed files—src/exporters/types.ts, src/exporters/http-json.ts, src/exporters/websocket.ts, and src/exporters/index.ts—along with the configuration changes. Done means the default HTTP JSON and WebSocket behaviors remain compatible while the exporter interface and custom exporter path are available; note that v2.5.0 and #137 are dependencies.
Written by the indexing model from the issue text.
Description
Summary
Refactor sendLogs.ts into a pluggable LogExporter interface. This is the architectural keystone for OTLP support and custom export targets.
Motivation
Currently sendLogs.ts tightly couples batch management, transport (XHR/fetch/sendBeacon), and auth header construction. This makes it impossible to add new output formats (OTLP, custom backends) without duplicating the batch logic.
Proposed Interface
interface LogExporter {
export(logs: Logging.Log[]): Promise<ExportResult>;
flush(): Promise<void>;
shutdown(): Promise<void>;
}
Implementation
src/exporters/types.ts— LogExporter interfacesrc/exporters/http-json.ts— Extract current sendLogs behavior (default)src/exporters/websocket.ts— Extract current WebSocket behaviorsrc/exporters/index.ts— Factory: config → exportersrc/sendLogs.ts— Simplified to batch manager + exporter.export()
Config Changes
exporterType?: 'http-json' | 'otlp' | 'websocket' | 'custom';
exporter?: LogExporter; // for custom exporters
Backward Compatibility
Existing users who set url: 'https://my-server/logs' must work identically. HttpJsonExporter is the default. No config change needed.
Depends On
- v2.5.0 release (foundation)
- #137 (toolchain modernization)
- Dominant language
- Jupyter Notebook
- Stars
- 30
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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 clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100