Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG] - Unable to support concurrent requests with multiple Datadog exporter #531

Open
1 task done
bkamin29 opened this issue Nov 21, 2024 · 0 comments
Open
1 task done
Assignees
Labels
bug Something isn't working triage

Comments

@bkamin29
Copy link

bkamin29 commented Nov 21, 2024

SLO Generator Version

2.*

Python Version

3.11

What happened?

I’ve encountered a limitation with the current implementation of the Datadog expoter in slo-generator. Currently, it is not possible to declare multiple Datadog exporters for concurrent SLO reporting. This limitation stems from the use of the datadog Python module, which relies on a globally shared configuration instead of independent client objects.

Issue Details

Since the Datadog exporter implementation in slo-generator uses the datadog module directly, it lacks the ability to isolate multiple configurations or handle concurrent requests without shared session data or interference between clients. The global state maintained by the datadog module means that requests to separate Datadog instances (or with different API keys) overwrite each other’s configurations, preventing the independent handling of multiple Datadog exporters.

Consequence

If concurrency is enabled—such as when running slo-generator in a cloud environment like Cloud Functions or in API mode with Cloud Run—the global configuration issue causes slo-generator to send SLO calculations to the incorrect Datadog organization. This can result in inaccurate reporting and potential data leaks between organizations.

Suggested Solution

A potential solution would be to refactor the Datadog exporter in slo-generator to use the datadog-api-client library instead. This library enables the creation of isolated Datadog API clients and supports better concurrency control by avoiding global state. Each client instance can be configured independently, allowing for multiple Datadog exporters within slo-generator to operate concurrently and without interference.

Steps to Reproduce

  1. Declare multiple Datadog exporters in slo-generator, each with different configurations.
  2. Enable concurrency (e.g., deploy slo-generator as a Cloud Function or API with Cloud Run).
  3. Observe that requests may be routed to the incorrect Datadog organization, leading to unexpected behavior.
  4. Additionally, attempting to instantiate multiple client objects by printing each one (print(client)) will consistently return the same result, indicating that the instances are not isolated despite different configurations.

Expected Behavior

Each Datadog exporter should be able to operate with its own independent configuration and handle concurrent requests without affecting other exporters.

Additional Context

Refactoring to use datadog-api-client would improve flexibility and make it easier to implement robust multi-exporter configurations with Datadog in slo-generator.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bkamin29 bkamin29 added bug Something isn't working triage labels Nov 21, 2024
@bkamin29 bkamin29 changed the title [BUG] - Unable to support concurrent requests with multiple Datadog exporters 🐛 [BUG] - Unable to support concurrent requests with multiple Datadog exporter Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants