traceloop / traceloop/openllmetry
🚀 Feature: make "ImageUploader" pluggable.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.4k
- Forks
- 1.1k
- Avg merge
- 8d 14h
- Merged PRs (30d)
- 2
Description
Which component is this feature for?
Traceloop SDK
🔖 Feature description
More clearly define the interface of ImageUploader, make it an abstract base class (moving current implementation to a TraceloopImageUploader), and define a mechanism for constructing/selecting/plugging different implementations (as well as guidance regarding where different implementations of the base class ought to live).
🎤 Why is this feature needed ?
In order to allow this feature to work with other backends/vendors, there needs to be a way to swap out different implementations.
For some additional context, I'm currently working on sample code for Google Cloud / OpenLLMetry integration:
As part of that, I am implementing an alternative ImageUploader:
There is a bit of a code smell, though, in that it would seem wrong to inherit from traceloop.sdk.ImageUploader due to traceloop.sdk.ImageUploader not being purely abstract. On the other hand, simply following the shape/outline of traceloop.sdk.ImageUploader without inheritance seems error prone.
Separately from the above concern, I am thinking about where such an implementation ought to live in the long run and how to make alternative implementations of this easily discoverable. Where images get stored could conceivably be orthogonal to which observability backend is used; for example, as long as there was a way to configure the ACLs to grant the observability backend the necessary access, the observability backend and storage backend might be different [e.g. a Traceloop user storing images in GCS; a Google Cloud Observability user storing images in S3].
✌️ How do you aim to achieve this?
It would be a good start to just split ImageUploader into an abstract base class and a concrete, default implementation.
Beyond this, clearer comments on the interface to make the meaning clear. Perhaps some slight renaming (e.g. from image_file to base64_data_string, if I understand its format correctly). Type annotations, too.
Then, after that, perhaps some structure around how to organize implementations of it. Perhaps putting the concrete implementation in a separate file in a subfolder for implementations, along with instructions on where/how to contribute alternative implementations.
🔄️ Additional Information
No response
👀 Have you spent some time to check if this feature request has been raised before?
- I checked and didn't find similar issue
Are you willing to submit PR?
Yes I am willing to submit a PR!
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 by locating the existing traceloop.sdk.ImageUploader entry point and its current implementation. Define the abstract interface, move the default behavior into TraceloopImageUploader, and establish how alternative implementations are selected and organized. Done means the default behavior still works, implementations can be swapped, and the interface and contribution guidance are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100