-
Couldn't load subscription status.
- Fork 60
release(js-sdk): v0.6.0 #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
675e658
chore(js-sdk): port dependabot updates
ewanharris 079dfc3
feat(js-sdk): add opentelemetry metrics reporting
ewanharris 1cf0634
release(js-sdk): v0.6.0
ewanharris d609c8c
docs(js-sdk): include information about the opentelemetry data produced
ewanharris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
config/clients/js/patches/add-method-specific-attributes.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| diff --git a/api.ts b/api.ts | ||
| index e45e6c2..260e0bc 100644 | ||
| --- a/api.ts | ||
| +++ b/api.ts | ||
| @@ -759,6 +759,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.check(storeId, body, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "check", | ||
ewanharris marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| + [attributeNames.requestStoreId]: storeId, | ||
| + [attributeNames.user]: body.tuple_key.user | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -785,6 +787,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.deleteStore(storeId, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "deleteStore", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -799,6 +802,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.expand(storeId, body, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "expand", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -812,6 +816,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.getStore(storeId, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "getStore", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -826,6 +831,8 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.listObjects(storeId, body, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "listObjects", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| + [attributeNames.user]: body.user | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -854,6 +861,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.listUsers(storeId, body, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "listUsers", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -868,6 +876,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.read(storeId, body, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "read", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -882,6 +891,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.readAssertions(storeId, authorizationModelId, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "readAssertions", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -896,6 +906,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.readAuthorizationModel(storeId, id, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "readAuthorizationModel", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -911,6 +922,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.readAuthorizationModels(storeId, pageSize, continuationToken, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "readAuthorizationModels", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -927,6 +939,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.readChanges(storeId, type, pageSize, continuationToken, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "readChanges", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -941,6 +954,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.write(storeId, body, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "write", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -956,6 +970,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.writeAssertions(storeId, authorizationModelId, body, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "writeAssertions", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| /** | ||
| @@ -970,6 +985,7 @@ export const OpenFgaApiFp = function(configuration: Configuration, credentials: | ||
| const localVarAxiosArgs = await localVarAxiosParamCreator.writeAuthorizationModel(storeId, body, options); | ||
| return createRequestFunction(localVarAxiosArgs, globalAxios, configuration, credentials, { | ||
| [attributeNames.requestMethod]: "writeAuthorizationModel", | ||
| + [attributeNames.requestStoreId]: storeId, | ||
| }); | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,4 +17,4 @@ updates: | |
| groups: | ||
| dependencies: | ||
| patterns: | ||
| - "*" | ||
| - "*" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # 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. | ||
|
|
||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
| ## Metrics | ||
|
|
||
| ### Supported Metrics | ||
|
|
||
| | Metric Name | Type | Description | | ||
| |---------------------------------|-----------|---------------------------------------------------------------------------------| | ||
| | `fga-client.request.duration` | Histogram | The total request time for FGA requests | | ||
| | `fga-client.query.duration` | Histogram | The amount of time the FGA server took to process the request | | ||
| |` fga-client.credentials.request`| Counter | The total number of times a new token was requested when using ClientCredentials| | ||
|
|
||
| ### Supported attributes | ||
|
|
||
| | Attribute Name | Type | Description | | ||
| |--------------------------------|----------|-------------------------------------------------------------------------------------| | ||
| | `fga-client.response.model_id` | `string` | The authorization model ID that the FGA server used | | ||
| | `fga-client.request.method` | `string` | The FGA method/action that was performed | | ||
| | `fga-client.request.store_id` | `string` | The store ID that was sent as part of the request | | ||
| | `fga-client.request.model_id` | `string` | The authorization model ID that was sent as part of the request, if any | | ||
| | `fga-client.request.client_id` | `string` | The client ID associated with the request, if any | | ||
| | `fga-client.user` | `string` | The user that is associated with the action of the request for check and list users | | ||
| | `http.status_code ` | `int` | The status code of the response | | ||
| | `http.method` | `string` | The HTTP method for the request | | ||
| | `http.host` | `string` | Host identifier of the origin the request was sent to | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.