Skip to content

Make disable_batch user-configurable for auto_instrument #40

@benedict-khoo-sap

Description

@benedict-khoo-sap

Describe the Problem

In auto_instrument, Traceloop.init is called with a hardcoded value of disable_batch=True. This causes SimpleSpanProcessor to always be used instead of BatchSpanProcessor, which makes span processing and exporting essentially sequential and is not recommended as a default choice.

I used auto_instrument to instrument my agent, writing to SAP's Cloud Logging Service and then hit the agent with around 9 concurrent requests (not very much). Then I manually patched auto_instrument to use disable_batch=False and re-ran the same workload and the agent's response time went from about 40s per request (with disable_batch=True) to about 5s per request (with disable_batch=False).

Therefore, I strongly believe that disable_batch should be set to False as a default or at least be user-configurable because sequential exporting has way too much overhead for a simple use case.

Propose a Solution

Provide a user-configurable way (e.g. env var or parameter to auto_instrument) to allow non-sequential span exporting.

I also propose setting the default value to disable_batch=False instead of disable_batch=True.

Describe Alternatives

No response

Affected Development Phase

Release

Impact

Impaired

Timeline

Code freeze in 1 week

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions