Skip to content

Commit c54802c

Browse files
committed
docs(http-instrumentation): clarify usage of ignoreOutgoingRequestHook option
1 parent 45d0986 commit c54802c

File tree

1 file changed

+5
-1
lines changed
  • experimental/packages/opentelemetry-instrumentation-http

1 file changed

+5
-1
lines changed

experimental/packages/opentelemetry-instrumentation-http/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,18 @@ You can set the following:
6262
| `startIncomingSpanHook` | `StartIncomingSpanCustomAttributeFunction` | Function for adding custom attributes before a span is started in incomingRequest |
6363
| `startOutgoingSpanHook` | `StartOutgoingSpanCustomAttributeFunction` | Function for adding custom attributes before a span is started in outgoingRequest |
6464
| `ignoreIncomingRequestHook` | `IgnoreIncomingRequestFunction` | Http instrumentation will not trace all incoming requests that matched with custom function |
65-
| `ignoreOutgoingRequestHook` | `IgnoreOutgoingRequestFunction` | Http instrumentation will not trace all outgoing requests that matched with custom function |
65+
| `ignoreOutgoingRequestHook` | `IgnoreOutgoingRequestFunction` | Function to determine if an outgoing request should be ignored (not traced). The function receives the outgoing request options and should return `true` to skip tracing for that request, or `false` to allow tracing. See below for details. |
6666
| `disableOutgoingRequestInstrumentation` | `boolean` | Set to true to avoid instrumenting outgoing requests at all. This can be helpful when another instrumentation handles outgoing requests. |
6767
| `disableIncomingRequestInstrumentation` | `boolean` | Set to true to avoid instrumenting incoming requests at all. This can be helpful when another instrumentation handles incoming requests. |
6868
| `serverName` | `string` | The primary server name of the matched virtual host. |
6969
| `requireParentforOutgoingSpans` | Boolean | Require that is a parent span to create new span for outgoing requests. |
7070
| `requireParentforIncomingSpans` | Boolean | Require that is a parent span to create new span for incoming requests. |
7171
| `headersToSpanAttributes` | `object` | List of case insensitive HTTP headers to convert to span attributes. Client (outgoing requests, incoming responses) and server (incoming requests, outgoing responses) headers will be converted to span attributes in the form of `http.{request\|response}.header.header_name`, e.g. `http.response.header.content_length` |
7272

73+
#### `ignoreOutgoingRequestHook`
74+
75+
The `ignoreOutgoingRequestHook` option allows you to provide a function to determine whether a specific outgoing HTTP/HTTPS request should be ignored (not traced). The function is called with the outgoing request options and should return `true` to skip tracing for that request, or `false` to allow tracing. If the function throws an error, the error will be caught and logged, and the request will be traced by default.
76+
7377
## Semantic Conventions
7478

7579
Prior to version `0.54.0`, this instrumentation created spans targeting an experimental semantic convention [Version 1.7.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/semantic_conventions/README.md).

0 commit comments

Comments
 (0)