Closed rhamzeh closed 2 months ago
Attention: Patch coverage is 73.87580%
with 122 lines
in your changes missing coverage. Please review.
Project coverage is 33.01%. Comparing base (
f76e9eb
) to head (a3489ed
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
Introduces OpenTelemetry metrics reporting into the SDK for specific actions. We're intentionally starting with only a few metric events that we can then grow over time.
We don't have any formal documentation for this currently. We'll write this as we roll it out across all SDKs, so here is a summary of the events and the associated attributes:
Metrics
Supported Metrics
fga-client.request.duration
fga-client.query.duration
fga-client.credentials.request
fga-client.request.count
Supported attributes
fga-client.response.model_id
string
fga-client.request.method
string
Check
,ListObjects
, ...) in TitleCasefga-client.request.store_id
string
fga-client.request.model_id
string
fga-client.request.client_id
string
fga-client.user
string
http.request.resend_count
int
1
means the request was retried once in addition to the original request)http.response.status_code
int
http.request.method
string
http.host
string
url.scheme
string
http
/https
)url.full
string
user_agent.original
string
Testing
Spin up Prometheus, build the project and then run the OpenTelemetryExample app.
You should see metrics in Prometheus such as:
Also for client credential exchange, you should see metrics such as:
References
Closes #68
Follows the implementations in JS (https://github.com/openfga/js-sdk/pull/117), Python (https://github.com/openfga/python-sdk/pull/107) and Java (https://github.com/openfga/java-sdk/pull/94)
Review Checklist
main