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

fix: api client should set default telemetry if not specified #160

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

jimmyjames
Copy link
Contributor

Ensure that a default telemetry instance is created when creating an API client directly.

Description

When a Configuration is created via NewConfiguration, we ensure that a default telemetry is created if not specified. However, when creating a Configuration directly as shown in #466, no telemetry is created. This causes telemetry.Get to create a new telemetry instance on each call (e.g., each API call), which causes the map to grow unbounded.

This change ensures that a default Telemetry instance is created when creating a new APIClient.

References

openfga/sdk-generator#466

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@jimmyjames jimmyjames requested a review from a team as a code owner January 22, 2025 19:52
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 25.70%. Comparing base (9b6f886) to head (ac935fb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #160      +/-   ##
==========================================
+ Coverage   25.68%   25.70%   +0.01%     
==========================================
  Files         104      104              
  Lines       12577    12580       +3     
==========================================
+ Hits         3231     3234       +3     
  Misses       9075     9075              
  Partials      271      271              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jimmyjames jimmyjames added this pull request to the merge queue Jan 24, 2025
Merged via the queue into main with commit 1ddaa43 Jan 24, 2025
9 checks passed
@jimmyjames jimmyjames deleted the fix/tel-mem-leak branch January 24, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants