As a consumer of the SDK, I would like to hook it to my dashboards to get data on several metrics, as well being able to configure proper logging and tracing
Describe the ideal solution
For each SDK, users should be able to set up and connect to their infra
Phase 1: Metrics
Phase 2: Logging
Phase 3: Tracing
Metrics:
The latency of the request, split into
time it took since dev called the method until they get a response
time it took since the sdk issued a request to the API until it got a response
time reported by the server (query_duration_ms header)
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, as well being able to configure proper logging and tracing
Describe the ideal solution
For each SDK, users should be able to set up and connect to their infra
Metrics:
The latency of the request, split into
Response codes
Error codes and method
Method calls
[ ] JS: https://github.com/openfga/js-sdk/issues/108
[ ] Go: https://github.com/openfga/go-sdk/issues/105
[ ] .NET: TODO
[ ] Python: https://github.com/openfga/python-sdk/issues/93
[ ] Java: TODO
Logging:
Q: Should we have an option to log the full response? The headers? Full response will be a problem in list objects/users
Tracing:
Full trace of a request
Propagate the trace ID both from their app and to the OpenFGA server so that they can follow a request from their app to FGA
[ ] JS: TODO
[ ] Go: TODO
[ ] .NET: TODO
[ ] Python: TODO
[ ] Java: TODO
Documentation
Configuration
For each, SDK we need to allow the configuration of tracing, metrics and logging
For example, in the JS SDK, we may add: (note - config structure may change), based on the server config
Implementation
We will be using OpenTelemetry, e.g. open-telemetry/opentelemetry-js (for JS) or the appropriate SDK for each language: Language APIs & SDKs
Alternatives and current workarounds
No response
References
No response
Additional context
Roadmap Item: https://github.com/openfga/roadmap/issues/41