Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pkanal committed Jan 21, 2025
1 parent 2b1c2ff commit f86e206
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ Pass these options to the HoneycombWebSDK:

| name | required? | type | default value | description |
| ---- | --------- | ---- | ------------- | ----------- |
| enabled | optional | boolean | `true` | Where or not to enable this auto instrumentation. |
| enabled | optional | boolean | `true` | Whether or not to enable this auto instrumentation. |
| applyCustomAttributesOnSpan | optional | function | n/a | A callback function for adding custom attributes to the span when an error is recorded. Will automatically be applied to all spans generated by the auto-instrumentation. |

#### `recordException` Helper Function

Expand All @@ -129,14 +130,16 @@ The `recordException` function is a utility to send exception spans with semanti
| Parameter | Type | Default Value | Description |
|-------------|------------|----------------------------------------|-----------------------------------------------------------------------------|
| `error` | `Error` | N/A | The error object to record. This should be an instance of the JavaScript `Error` class. |
| `attributes`| `Attributes`| `{}` | Additional attributes to add to the span. This can include any custom metadata you want to associate with the error. |
| `attributes`| `Attributes`| `{}` | Additional attributes to add to the span. This can include any custom metadata you want to associate with the error. Will likely be deprecated in favour of using the callback function option `applyCustomAttributesOnSpan` in the future. |
| `tracer` | `Tracer` | `trace.getTracer(LIBRARY_NAME)` | The tracer to use for recording the span. If not provided, the default tracer for the library will be used. |
| `applyCustomAttributesOnSpan` | function | n/a | A callback function for adding custom attributes to the span when an error is recorded. |

```js
recordException(
error: Error,
attributes?: Attributes,
tracer?: Tracer
tracer?: Tracer,
applyCustomAttributesOnSpan?
): void
```
Expand Down

0 comments on commit f86e206

Please sign in to comment.