diff --git a/specs/agents/tracing-instrumentation-db.md b/specs/agents/tracing-instrumentation-db.md index e4f14613..f5672598 100644 --- a/specs/agents/tracing-instrumentation-db.md +++ b/specs/agents/tracing-instrumentation-db.md @@ -117,11 +117,15 @@ The following fields are relevant for database and datastore spans. Where possib |`action`| `request` | | __**context.db._**__ |
|
| |`_.instance`| e.g. `my-cluster` | [Cluster name](#cluster-name), if available. -|`_.statement`| e.g.
{"query": {"match": {"user.id": "kimchy"}}}
| For Elasticsearch search-type queries, the request body may be recorded. Alternatively, if a query is specified in HTTP query parameters, that may be used instead. If the body is gzip-encoded, the body should be decoded first.| +|`_.statement`| e.g.
{"query": {"match": {"user.id": "kimchy"}}}
| For Elasticsearch search-type queries, the request body SHOULD be recorded according to the `elasticsearch_capture_body_urls` option (see below). If the body is gzip-encoded, the body MUST be decoded first.| |`_.type`|`elasticsearch`| |`_.user`| :heavy_minus_sign: | |`_.link`| :heavy_minus_sign: | |`_.rows_affected`| :heavy_minus_sign: | +| __**context.http._**__ |
|
| +|`_.status_code`|`200`| +|`_.method`|`GET`| +|`_.url`|`https://localhost:9200/index/_search?q=user.id:kimchy`| | __**context.destination._**__ |
|
| |`_.address`|e.g. `localhost`| |`_.port`|e.g. `5432`| @@ -146,6 +150,18 @@ The Elasticsearch cluster name is not always available in ES clients, as a resul - Instrument `_node/http` calls and cache the result in the agent with `host:port` as key. - execute a request to Elasticsearch and cache the result in the agent with `host:port` as key. +#### `elasticsearch_capture_body_urls` configuration + +The URL patterns for which the agent is capturing the request body for Elasticsearch clients. + +Agents MAY offer this configuration option. +If they don't, they MUST use a hard-coded list of URLs that correspond with the default value of this option. + +| | | +|----------------|------------| +| Type | `List<`[`WildcardMatcher`](../../tests/agents/json-specs/wildcard_matcher_tests.json)`>` | +| Default | `*/_search, */_search/template, */_msearch, */_msearch/template, */_async_search, */_count, */_sql, */_eql/search`| +| Central config | `false` ### MongoDB