From 13fecbe52719436f5469f8c7e0b9946ed7c2832c Mon Sep 17 00:00:00 2001 From: S A G A R <110724849+tmsagarofficial@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:12:04 +0530 Subject: [PATCH 1/6] Update opentelemetry.md --- docs/opentelemetry.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/opentelemetry.md b/docs/opentelemetry.md index c259fcf..debd473 100644 --- a/docs/opentelemetry.md +++ b/docs/opentelemetry.md @@ -1,8 +1,8 @@ # OpenTelemetry -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. +This SDK produces [metrics](https://opentelemetry.io/docs/concepts/signals/metrics/) using [OpenTelemetry](https://opentelemetry.io/) to allow you to view data such as request timings. These metrics also include attributes for the model and store ID and the API called to allow you to build reporting. -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. +When an OpenTelemetry SDK instance is configured, the metrics will be exported and sent to the collector configured as part of your application's configuration. If you are not using OpenTelemetry, the metric functionality is a no-op, and the events are never sent. 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. @@ -40,7 +40,7 @@ In cases when metrics events are sent, they will not be viewable outside of infr Not all attributes are enabled by default. -Some attributes, like `fga-client.user` have been disabled by default due to their high cardinality, which may result for very high costs when using some SaaS metric collectors. If you expect to have a high cardinality for a specific attribute, you can disable it by updating the telemetry configuration accordingly. +Some attributes, like `fga-client.user` have been disabled by default due to their high cardinality, which may result in very high costs when using some SaaS metric collectors. If you expect high cardinality for a specific attribute, you can disable it by updating the telemetry configuration accordingly. If your configuration does not specify a given metric, the default attributes for that metric will be used. @@ -97,4 +97,4 @@ const fgaClient = new OpenFgaClient({ ## Example -There is an [example project](https://github.com/openfga/js-sdk/blob/main/example/opentelemetry) that provides some guidance on how to configure OpenTelemetry available in the examples directory. \ No newline at end of file +There is an [example project](https://github.com/openfga/js-sdk/blob/main/example/opentelemetry) that provides some guidance on how to configure OpenTelemetry available in the examples directory. From a421bd65d5e7ce6aeee6c8f4720db8312b3e39e3 Mon Sep 17 00:00:00 2001 From: S A G A R <110724849+tmsagarofficial@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:13:05 +0530 Subject: [PATCH 2/6] Update README.md --- example/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/README.md b/example/README.md index 35456e1..59593b1 100644 --- a/example/README.md +++ b/example/README.md @@ -4,7 +4,7 @@ A set of Examples on how to call the OpenFGA JS SDK ### Examples Example 1: -A bare-bones example. It creates a store, and runs a set of calls against it including creating a model, writing tuples and checking for access. +A bare-bones example. It creates a store and runs a set of calls against it including creating a model, writing tuples, and checking for access. OpenTelemetry: An example that demonstrates how to integrate the OpenFGA JS SDK with OpenTelemetry. @@ -28,7 +28,7 @@ Steps Steps 1. Build the SDK -2. In the Example `package.json` change the `@openfga/sdk` dependency from a semver range like below +2. In the Example `package.json` change the `@openfga/sdk` dependency from a server range like below ```json "dependencies": { "@openfga/sdk": "^0.7.0" @@ -42,4 +42,4 @@ to a `file:` reference like below ``` 3. If you have an OpenFGA server running, you can use it, otherwise run `make run-openfga` to spin up an instance (you'll need to switch to a different terminal after - don't forget to close it when done) 4. Run `make setup` to install dependencies -5. Run `make run` to run the example \ No newline at end of file +5. Run `make run` to run the example From 613443037697d913f1e46f14fbbf2da1264b4c4c Mon Sep 17 00:00:00 2001 From: S A G A R <110724849+tmsagarofficial@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:15:54 +0530 Subject: [PATCH 3/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 517e744..c0a2091 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ yarn add @openfga/sdk [Learn how to initialize your SDK](https://openfga.dev/docs/getting-started/setup-sdk-client) -We strongly recommend you initialize the `OpenFgaClient` only once and then re-use it throughout your app, otherwise you will incur the cost of having to re-initialize multiple times or at every request, the cost of reduced connection pooling and re-use, and would be particularly costly in the client credentials flow, as that flow will be preformed on every request. +We strongly recommend you initialize the `OpenFgaClient` only once and then re-use it throughout your app, otherwise you will incur the cost of having to re-initialize multiple times or at every request, the cost of reduced connection pooling and re-use, and would be particularly costly in the client credentials flow, as that flow will be performed on every request. > The `OpenFgaClient` will by default retry API requests up to 15 times on 429 and 5xx errors. @@ -670,7 +670,7 @@ If a network request fails with a 429 or 5xx error from the server, the SDK will To customize this behavior, create an object with `maxRetry` and `minWaitInMs` properties. `maxRetry` determines the maximum number of retries (up to 15), while `minWaitInMs` sets the minimum wait time between retries in milliseconds. -Apply your custom retry values by setting to `retryParams` on the to the configuration object passed to the `OpenFgaClient` call. +Apply your custom retry values by setting to `retryParams` on to the configuration object passed to the `OpenFgaClient` call. ```javascript const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk'; From 9a428ef509b5f86661582307fb7a55a6e1127a73 Mon Sep 17 00:00:00 2001 From: S A G A R <110724849+tmsagarofficial@users.noreply.github.com> Date: Mon, 7 Oct 2024 21:28:45 +0530 Subject: [PATCH 4/6] Update README.md Co-authored-by: Ewan Harris --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c0a2091..427729b 100644 --- a/README.md +++ b/README.md @@ -670,7 +670,7 @@ If a network request fails with a 429 or 5xx error from the server, the SDK will To customize this behavior, create an object with `maxRetry` and `minWaitInMs` properties. `maxRetry` determines the maximum number of retries (up to 15), while `minWaitInMs` sets the minimum wait time between retries in milliseconds. -Apply your custom retry values by setting to `retryParams` on to the configuration object passed to the `OpenFgaClient` call. +Apply your custom retry values by setting to `retryParams` on the configuration object passed to the `OpenFgaClient` call. ```javascript const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk'; From 2d032389368d0f634404c7fdd83bfcfb44c98e71 Mon Sep 17 00:00:00 2001 From: S A G A R <110724849+tmsagarofficial@users.noreply.github.com> Date: Mon, 7 Oct 2024 21:29:04 +0530 Subject: [PATCH 5/6] Update example/README.md Co-authored-by: Ewan Harris --- example/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/README.md b/example/README.md index 59593b1..281ed3d 100644 --- a/example/README.md +++ b/example/README.md @@ -28,7 +28,7 @@ Steps Steps 1. Build the SDK -2. In the Example `package.json` change the `@openfga/sdk` dependency from a server range like below +2. In the Example `package.json` change the `@openfga/sdk` dependency from a semver range like below ```json "dependencies": { "@openfga/sdk": "^0.7.0" From 1103aed5ce2b27d832fd5a22c2bc05952c671dfe Mon Sep 17 00:00:00 2001 From: S A G A R <110724849+tmsagarofficial@users.noreply.github.com> Date: Mon, 7 Oct 2024 21:31:14 +0530 Subject: [PATCH 6/6] Update docs/opentelemetry.md Co-authored-by: Ewan Harris --- docs/opentelemetry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/opentelemetry.md b/docs/opentelemetry.md index debd473..5f7460d 100644 --- a/docs/opentelemetry.md +++ b/docs/opentelemetry.md @@ -2,7 +2,7 @@ This SDK produces [metrics](https://opentelemetry.io/docs/concepts/signals/metrics/) using [OpenTelemetry](https://opentelemetry.io/) to allow you to view data such as request timings. These metrics also include attributes for the model and store ID and the API called to allow you to build reporting. -When an OpenTelemetry SDK instance is configured, the metrics will be exported and sent to the collector configured as part of your application's configuration. If you are not using OpenTelemetry, the metric functionality is a no-op, and the events are never sent. +When an OpenTelemetry SDK instance is configured, the metrics will be exported and sent to the collector configured as part of your application's configuration. If you are not using OpenTelemetry, the metric functionality is a no-op and the events are never sent. 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.