fix: disable http request duration metric by default#344
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Related Documentation 1 document(s) may need updating based on files changed in this PR: OpenFGA's Space OpenTelemetry Metrics IntegrationView Suggested Changes@@ -11,7 +11,7 @@
| `fga-client.request.duration` | Histogram | Yes | Total request time for FGA requests (milliseconds) |
| `fga-client.query.duration` | Histogram | Yes | Time taken by the FGA server to process and evaluate the request (milliseconds) |
| `fga-client.credentials.request` | Counter | Yes | Total number of new token requests initiated using the Client Credentials flow |
-| `fga-client.http_request.duration` | Histogram | Yes | Time taken for a single HTTP request to complete, including retries (milliseconds) |
+| `fga-client.http_request.duration` | Histogram | No | Time taken for a single HTTP request to complete, including retries (milliseconds) |
[See JavaScript SDK documentation](https://github.com/openfga/js-sdk/blob/main/docs/opentelemetry.md#metrics)
[See Java SDK documentation](https://github.com/openfga/java-sdk/blob/main/docs/OpenTelemetry.md#metrics)
@@ -86,16 +86,15 @@
TelemetryAttribute.HttpRequestResendCount,
])
},
- histogramHttpRequestDuration: {
- attributes: new Set([
- TelemetryAttribute.HttpResponseStatusCode,
- TelemetryAttribute.UserAgentOriginal,
- TelemetryAttribute.HttpRequestMethod,
- TelemetryAttribute.HttpHost,
- TelemetryAttribute.UrlFull,
- TelemetryAttribute.UrlScheme,
- ])
- }
+ // Optional: Enable per-HTTP-request metrics (disabled by default due to high cardinality)
+ // histogramHttpRequestDuration: {
+ // attributes: new Set([
+ // TelemetryAttribute.HttpHost,
+ // TelemetryAttribute.HttpResponseStatusCode,
+ // TelemetryAttribute.HttpRequestMethod,
+ // TelemetryAttribute.UserAgentOriginal,
+ // ])
+ // }
}
};
@@ -225,6 +224,7 @@
- If OpenTelemetry is not configured, metrics are not sent (no-op).
- The Java SDK supports both manual configuration and Java Agent (automatic instrumentation with zero code changes).
- High-cardinality attributes (like `fga-client.user`) are disabled by default to avoid excessive costs with some metric collectors. Enable only if necessary.
+- The `fga-client.http_request.duration` metric is disabled by default because it tracks every individual HTTP request (including each retry attempt), which can generate a high volume of telemetry data and result in increased costs. You can enable it explicitly in your configuration if you need granular per-request metrics.
- The `fga-client.request.batch_check_size` attribute is disabled by default in both Java and .NET SDKs as it only applies to BatchCheck requests. It can be explicitly enabled in the telemetry configuration if needed for monitoring batch check request sizes.
---Note: You must be authenticated to accept/decline updates. |
Description
For
openfga/dotnet-sdk#173 (review)
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
Review Checklist
main