Earn 10,800 ($108.00)
Add tracing support to Rebuff.ai
Bounty Description
Add Tracing Support to Rebuff.ai
Summary:
We want to improve our performance measurement capabilities for our open source project, Rebuff.ai. Your task is to integrate tracing support throughout the entire codebase, including the Python and JavaScript SDKs and the NodeJS server.
Key Task Details:
- Add Tracing Support: For both the Python and JavaScript SDKs, you should incorporate functionality that enables users to provide their tracing instance, which should be passed in during the initialization of the library.
- Utilize Google Cloud Trace: For production monitoring purposes, we will be utilizing Google Cloud Trace. Please follow the guidelines found here to get a sense for how to integrate support for Google Cloud Trace.
- Provision Jaeger Tracing Server: For testing purposes, provision a Jaeger tracing server when tests start, and send trace events to this server.
- Write Tests: Develop two tests: one for the standalone JavaScript SDK, and another for the Python SDK interacting with the Rebuff Server. These tests should generate traces that are sent to the Jaeger tracing server. The goal here is to validate whether traces are functioning correctly. You only need to ensure that all traces are correctly sent to a Jaeger backend, and available for querying.
Acceptance Criteria:
- Successful integration of tracing support for Python and JavaScript SDKs and NodeJS server.
- Users can provide their tracing instance during library initialization.
- Support for Google Cloud Trace for monitoring purposes.
- A functioning Jaeger tracing server provisioned during test start.
- Two functional tests for the JavaScript SDK and Python SDK that verify traces are correctly sent to the Jaeger backend. If tracing is disabled/removed/broken then the test should fail. If the backend is not available then the test should also fail.
Additional Notes:
Please ensure that this task can be executed entirely from GitHub Actions or locally in an automated manner. Avoid using a managed service for this task.
FAQ
Q1: What tracing library should we use for Python and JavaScript?
A: For Python, the OpenTelemetry Python library is recommended. It's one of the most comprehensive libraries available, supporting automatic instrumentation of many frameworks and libraries, context propagation, and metrics. For JavaScript, the OpenTelemetry JavaScript library is suggested. It supports both browser and Node.js applications and also offers automatic instrumentation, context propagation, and metrics.
Q2: Is there a specific version of the Google Cloud Trace that we should be using?
A: Please use the latest stable version of Google Cloud Trace available at the time of development.
Q3: Can you suggest a method for passing the user's tracing instance during library initialization?
A: You could allow the user to pass in a tracing instance as an argument during the initialization of the library. This instance could then be used internally by the library. This would give the user flexibility in managing the tracing instance while also ensuring that tracing can be easily incorporated into our services.
Q4: Should we consider specific performance implications when adding tracing?
A: Yes, tracing can add overhead to a system and could impact performance. As a rule of thumb, ensure that the tracing system doesn't significantly slow down the services or interfere with their function. You should allow the user to set the sampling rate for tracing.
Q5: What if the Jaeger server is not available or goes down during testing?
A: You should handle such scenarios gracefully. The tests should fail with an appropriate error message if the Jaeger server is not available for any reason. However, this scenario should not cause the main service to crash or behave unexpectedly.
Q6: How do we ensure that the added tracing functionality doesn't break in the future?
A: Your test should fail if the tracing functionality is broken or breaks in the future