openfga / python-sdk

OpenFGA SDK for Python 3 - https://pypi.org/project/openfga-sdk/
https://openfga.dev
Apache License 2.0
38 stars 15 forks source link

fix: OpenTelemetry bugfixes #124

Closed evansims closed 2 months ago

evansims commented 2 months ago

Description

This PR fixes several bugs identified in the recent OpenTelemetry improvements:

References

Review Checklist

codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 63.46154% with 19 lines in your changes missing coverage. Please review.

Project coverage is 69.16%. Comparing base (4ecb08f) to head (b3225c0).

Files with missing lines Patch % Lines
openfga_sdk/telemetry/attributes.py 67.74% 10 Missing :warning:
openfga_sdk/telemetry/metrics.py 57.14% 9 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #124 +/- ## ========================================== + Coverage 69.14% 69.16% +0.01% ========================================== Files 121 121 Lines 9941 9982 +41 ========================================== + Hits 6874 6904 +30 - Misses 3067 3078 +11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

evansims commented 2 months ago

Can you also please:

  • Update the documentation page with

    1. the defaults
    2. How to configure it
  • Update the example with a sample configuration?
  • Add validation that they're not configuring with invalid meter/attribute names?

I'd prefer to do a documentation pass as a separate PR, but yup, that's on my radar.

Right now providing an invalid meter/attribute would just be ignored; I can add an exception for those instances. Updated the PR with that; added a test to cover it