Skip to content

Conversation

evansims
Copy link
Member

Description

Added:

  • Adds a per-HTTP request counter metric, fga-client.request. It is disabled by default.

Changed:

  • Method signature on credentialsRequest now uses 1 as the default parameter value.
  • Changed default unit type in TelemetryCounter/TelemetryCounters. It mistakenly used milliseconds as the default unit type for counters previously.
  • Refactored TelemetryHistogram/TelemetryHistograms to use the shared default milliseconds unit type; not necessary to define it each time.

Fixed:

  • Moved fromRequest step above exception handling in the synchronous API Client to ensure those attributes were properly collected there. This was already the case in the asynchronous API client.
  • Moved http.request.resend_count increment to the top of the retry loop for the synchronous API client to ensure the proper value is collected when an API exception is raised.

References

Closes #130

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
@evansims evansims added the enhancement New feature or request label Sep 23, 2024
@evansims evansims force-pushed the feat/otel/add-per-http-request-counter branch from 2211616 to f8e4d8b Compare September 23, 2024 16:49
@evansims evansims marked this pull request as ready for review September 23, 2024 16:49
@evansims evansims requested a review from a team as a code owner September 23, 2024 16:49
@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 76.66667% with 7 lines in your changes missing coverage. Please review.

Project coverage is 69.17%. Comparing base (a00f039) to head (916442d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
openfga_sdk/telemetry/configuration.py 55.55% 4 Missing ⚠️
openfga_sdk/telemetry/metrics.py 57.14% 3 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## main #135 +/- ## ========================================== + Coverage 69.15% 69.17% +0.01%  ========================================== Files 122 122 Lines 9746 9771 +25 ========================================== + Hits 6740 6759 +19  - Misses 3006 3012 +6 

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

@evansims evansims enabled auto-merge September 23, 2024 17:13
@evansims evansims changed the title feat: add per-HTTP request counter metric feat(OpenTelemetry): add per-HTTP request counter metric Sep 23, 2024
@evansims evansims force-pushed the feat/otel/add-per-http-request-counter branch from f8e4d8b to 5ccf6f8 Compare September 27, 2024 23:47
@evansims evansims force-pushed the feat/otel/add-per-http-request-counter branch from 5ccf6f8 to 916442d Compare October 2, 2024 05:43
@evansims evansims added this pull request to the merge queue Oct 10, 2024
Merged via the queue into main with commit 73652e8 Oct 10, 2024
16 checks passed
@evansims evansims deleted the feat/otel/add-per-http-request-counter branch October 10, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

3 participants