-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: add support for exporting metrics #69
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rhamzeh
force-pushed
the
feat/telemetry
branch
2 times, most recently
from
July 23, 2024 06:51
2b559f8
to
31f63c1
Compare
4 tasks
rhamzeh
force-pushed
the
feat/telemetry
branch
2 times, most recently
from
July 30, 2024 14:34
88a083e
to
0f20865
Compare
evansims
previously approved these changes
Jul 30, 2024
rhamzeh
force-pushed
the
feat/telemetry
branch
from
September 7, 2024 12:36
0f20865
to
538a045
Compare
In the cases where IsValid throws an error instead of returning false, it has been renamed to EnsureValid to make it clearer
rhamzeh
force-pushed
the
feat/telemetry
branch
from
September 7, 2024 12:41
538a045
to
4b983a4
Compare
evansims
approved these changes
Sep 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 (openfga/js-sdk#117), Python (openfga/python-sdk#107) and Java (openfga/java-sdk#94)
Review Checklist
main