Skip to content

Commit

Permalink
Typo fix and Improve readability (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris authored Oct 10, 2024
2 parents 5dcdb83 + 1103aed commit d24b5aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 the configuration object passed to the `OpenFgaClient` call.

```javascript
const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk';
Expand Down
8 changes: 4 additions & 4 deletions docs/opentelemetry.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.
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.
4 changes: 2 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
5. Run `make run` to run the example

0 comments on commit d24b5aa

Please sign in to comment.