Emit OpenTelemetry Metrics in the SDKs #352
Labels
dotnet-sdk
Affects the C#/DotNet SDK
enhancement
New feature or request
epic
go-sdk
Affects the Go SDK
java-sdk
Affects the Java/Kotlin SDK
js-sdk
Affects the JavaScript SDK
python-sdk
Affects the Python SDK
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: Export metrics js-sdk#108
Go: Export metrics go-sdk#105
.NET: Export Metrics dotnet-sdk#68
Python: Export metrics python-sdk#93
Java:Export Metrics java-sdk#92
We're thinking of adding "fine-grained" config for the attributes/tags.
Something along the lines of:
If not set, we would enable a base set of metrics with minimal attributes, if configured, we follow whatever is configured. We will couple that with warnings in the OTEL config documentation around which attributes could be cost-prohibitive.
Metrics needed
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
This allows folks to not enable this by accident (they'd have to manually opt-in), while giving them the ability to be able to have visibility on things like:
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: openfga/roadmap#41
The text was updated successfully, but these errors were encountered: