|
| 1 | +# OpenTelemetry |
| 2 | + |
| 3 | +This SDK produces [metrics](https://opentelemetry.io/docs/concepts/signals/metrics/) using [OpenTelemetry](https://opentelemetry.io/) that allow you to view data such as request timings. These metrics also include attributes for the model and store ID, as well as the API called to allow you to build reporting. |
| 4 | + |
| 5 | +When an OpenTelemetry SDK instance is configured, the metrics will be exported and sent to the collector configured as part of your applications configuration. If you are not using OpenTelemetry, the metric functionality is a no-op and the events are never sent. |
| 6 | + |
| 7 | +In cases when metrics events are sent, they will not be viewable outside of infrastructure configured in your application, and are never available to the OpenFGA team or contributors. |
| 8 | + |
| 9 | +## Metrics |
| 10 | + |
| 11 | +### Supported Metrics |
| 12 | + |
| 13 | +| Metric Name | Type | Description | |
| 14 | +| --------------------------------- | --------- | -------------------------------------------------------------------------------- | |
| 15 | +| `fga-client.request.duration` | Histogram | The total request time for FGA requests | |
| 16 | +| `fga-client.query.duration` | Histogram | The amount of time the FGA server took to process the request | |
| 17 | +| ` fga-client.credentials.request` | Counter | The total number of times a new token was requested when using ClientCredentials | |
| 18 | + |
| 19 | +### Supported attributes |
| 20 | + |
| 21 | +| Attribute Name | Type | Description | |
| 22 | +| ------------------------------ | -------- | ----------------------------------------------------------------------------------- | |
| 23 | +| `fga-client.response.model_id` | `string` | The authorization model ID that the FGA server used | |
| 24 | +| `fga-client.request.method` | `string` | The FGA method/action that was performed | |
| 25 | +| `fga-client.request.store_id` | `string` | The store ID that was sent as part of the request | |
| 26 | +| `fga-client.request.model_id` | `string` | The authorization model ID that was sent as part of the request, if any | |
| 27 | +| `fga-client.request.client_id` | `string` | The client ID associated with the request, if any | |
| 28 | +| `fga-client.user` | `string` | The user that is associated with the action of the request for check and list users | |
| 29 | +| `http.status_code ` | `int` | The status code of the response | |
| 30 | +| `http.method` | `string` | The HTTP method for the request | |
| 31 | +| `http.host` | `string` | Host identifier of the origin the request was sent to | |
0 commit comments