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

Export metrics #93

Closed
1 task done
rhamzeh opened this issue Jun 5, 2024 · 0 comments · Fixed by #107
Closed
1 task done

Export metrics #93

rhamzeh opened this issue Jun 5, 2024 · 0 comments · Fixed by #107
Assignees
Labels
enhancement New feature or request

Comments

@rhamzeh
Copy link
Member

rhamzeh commented Jun 5, 2024

Checklist

Describe the problem you'd like to have solved

As a consumer of the SDK, I would like to hook it to my dashboards to get data on several metrics.

Describe the ideal solution

Integrate the OpenTelemetry Python API /~https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-api (API docs)

Expose only from the inner OpenFgaApi. We need to be able to report the following metrics

Metric Name Type Description
fga-client.request.duration Histogram The total request time for FGA requests
fga-client.query.duration Histogram The amount of time the FGA server took to process the request
fga-client.credentials.request Counter The total number of times a new token was requested when using ClientCredentials

And the metrics should have the following attributes associated with them

Attribute Name Type Description
fga-client.response.model_id string The authorization model ID that the FGA server used
fga-client.request.method string The FGA method/action that was performed
fga-client.request.store_id string The store ID that was sent as part of the request
fga-client.request.model_id string The authorization model ID that was sent as part of the request, if any
fga-client.request.client_id string The client ID associated with the request, if any
fga-client.user string The user that is associated with the action of the request for check and list users
http.status_code int The status code of the response
http.method string The HTTP method for the request
http.host string Host identifier of the origin the request was sent to

We should create an overall meter for OpenFgaApi and then create counters, histograms as required for each metric we report.

For the semantically named attributes we can use the semantic conventions package https://pypi.org/project/opentelemetry-semantic-conventions/

@rhamzeh rhamzeh added the enhancement New feature or request label Jun 5, 2024
@rhamzeh rhamzeh moved this from Backlog to In progress in SDKs and Tooling Jun 18, 2024
@evansims evansims self-assigned this Jun 26, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in SDKs and Tooling Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants