Skip to content

fix: disable http request duration metric by default#344

Merged
SoulPancake merged 2 commits into
release/093from
fix/disable-http-duration-metric
Feb 25, 2026
Merged

fix: disable http request duration metric by default#344
SoulPancake merged 2 commits into
release/093from
fix/disable-http-duration-metric

Conversation

@SoulPancake

@SoulPancake SoulPancake commented Feb 25, 2026

Copy link
Copy Markdown
Member

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

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@coderabbitai

coderabbitai Bot commented Feb 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/disable-http-duration-metric

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SoulPancake
SoulPancake marked this pull request as ready for review February 25, 2026 13:25
@SoulPancake
SoulPancake requested a review from a team as a code owner February 25, 2026 13:25
@dosubot

dosubot Bot commented Feb 25, 2026

Copy link
Copy Markdown

Related Documentation

1 document(s) may need updating based on files changed in this PR:

OpenFGA's Space

OpenTelemetry Metrics Integration
View 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.
 
 ---

[Accept] [Decline]

Note: You must be authenticated to accept/decline updates.

How did I do? Any feedback?  Join Discord

@SoulPancake
SoulPancake merged commit d4240fe into release/093 Feb 25, 2026
24 checks passed
@SoulPancake
SoulPancake deleted the fix/disable-http-duration-metric branch February 25, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants