open-telemetry / open-telemetry/opentelemetry-ruby
Document/add concurrency-safety to Console and OTLP exporters' `ForceFlush`/`Shutdown`
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 606
- Forks
- 301
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 42
Description
Spec requirement
Each LogRecordExporter implementation MUST document its concurrency characteristics (sdk.md:612-613 (permalink)); ForceFlush and Shutdown MUST be safe for concurrent calls (sdk.md:712-713 (permalink)).
Current behavior
logs_sdk/lib/opentelemetry/sdk/logs/export/console_log_record_exporter.rb:27-34 (permalink) (#force_flush/#shutdown) mutate @stopped with no synchronization. exporter/otlp-logs/lib/opentelemetry/exporter/otlp/logs/logs_exporter.rb:108-112 (permalink) (#shutdown) mutates @shutdown and calls @http.finish with no mutex either. Only InMemoryLogRecordExporter (export/in_memory_log_record_exporter.rb:83-99) (permalink) guards this with @mutex.
Suggested fix
Add a mutex around @stopped/@shutdown mutation (and any shared @http access) in both ConsoleLogRecordExporter and the OTLP LogsExporter, and document the concurrency guarantee in each class's description.
Related rows in SPEC_COMPLIANCE_LOGS.md
SDK-42, SDK-50
Contributor guide
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.
Research direction
Start with logs_sdk/lib/opentelemetry/sdk/logs/export/console_log_record_exporter.rb and exporter/otlp-logs/lib/opentelemetry/exporter/otlp/logs/logs_exporter.rb, then compare the mutex usage in export/in_memory_log_record_exporter.rb. Review ForceFlush and Shutdown, including shared @http access in the OTLP exporter. Done means both exporters synchronize the relevant state and document their concurrency guarantees.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100