Skip to content

Commit

Permalink
docs(instrumentation-graphql): improve README.md (open-telemetry#569)
Browse files Browse the repository at this point in the history
* docs(instrumentation-graphql): improve README.md

* docs: updated README according to PR review

* fix(graphql): fixed graphql example 

it didn't work since @opentelemetry/api package was missing and update @opentelemetry/instrumentation-express
and 
@opentelemetry/instrumentation-graphql

Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
  • Loading branch information
syncush and obecny committed Jul 15, 2021
1 parent 4bf3ad5 commit 9dabf39
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
7 changes: 4 additions & 3 deletions examples/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
},
"dependencies": {
"@opentelemetry/api": "^1.0.1",
"@opentelemetry/exporter-collector": "^0.23.0",
"@opentelemetry/instrumentation": "^0.23.0",
"@opentelemetry/instrumentation-graphql": "^0.15.0",
"@opentelemetry/node": "^0.23.0",
"@opentelemetry/instrumentation-express": "^0.15.0",
"@opentelemetry/instrumentation-express": "^0.23.0",
"@opentelemetry/instrumentation-graphql": "^0.23.0",
"@opentelemetry/instrumentation-http": "^0.23.0",
"@opentelemetry/node": "^0.23.0",
"@opentelemetry/tracing": "^0.23.0",
"apollo-server": "^2.18.1",
"express": "^4.17.1",
Expand Down
17 changes: 16 additions & 1 deletion plugins/node/opentelemetry-instrumentation-graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

This module provides *automated instrumentation and tracing* for GraphQL in Node.js applications.

*Note*: graphql plugin instruments graphql directly. it should work with any package that wraps the graphql package (e.g apollo).

Minimum required graphql version is `v14`

## Installation

```shell script
Expand Down Expand Up @@ -38,12 +42,23 @@ registerInstrumentations({

```

## Optional Parameters

| Param | type | Default Value | Description | |
|:-----------:|:-------:|:-------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------:|:-:|
| mergeItems | boolean | false | Whether to merge list items into a single element. example: `users.*.name` instead of `users.0.name`, `users.1.name` | |
| depth | number | -1 | The maximum depth of fields/resolvers to instrument. When set to 0 it will not instrument fields and resolvers. When set to -1 it will instrument all fields and resolvers. | |
| allowValues | boolean | false | When set to true it will not remove attributes values from schema source. By default all values that can be sensitive are removed and replaced with "*" | |
| responseHook | GraphQLInstrumentationExecutionResponseHook | undefined | Hook that allows adding custom span attributes based on the data returned from "execute" GraphQL action. | |

## Examples
Can be found [here](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/graphql)

## Useful links

- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]

## License

Apache 2.0 - See [LICENSE][license-url] for more information.
Expand Down

0 comments on commit 9dabf39

Please sign in to comment.