Skip to content

Commit

Permalink
Ensure all the remarks make it into our documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolf committed Nov 26, 2020
1 parent 5e2c7f3 commit 7643c19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ incrementCounter(type: string, id: string, counterFieldNames: string[], options?

## Remarks

When using incrementCounter for collecting usage data, you need to ensure that usage collection happens on a best-effort basis and doesn't negatively affect your plugin or users (see the example): - Swallow any exceptions thrown from the incrementCounter method and log a message in development. - Don't block your application on the incrementCounter method (e.g. don't use `await`<!-- -->)
When supplying a field name like `stats.api.counter` the field name will be used as-is to create a document like: `{attributes: {'stats.api.counter': 1}}` It will not create a nested structure like: `{attributes: {stats: {api: {counter: 1}}}}`

## Example

Expand Down
2 changes: 1 addition & 1 deletion src/core/server/saved_objects/service/lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ export class SavedObjectsRepository {
* a message in development.
* - Don't block your application on the incrementCounter method (e.g.
* don't use `await`)
*
* @remarks
* When supplying a field name like `stats.api.counter` the field name will
* be used as-is to create a document like:
* `{attributes: {'stats.api.counter': 1}}`
Expand Down

0 comments on commit 7643c19

Please sign in to comment.