Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add elasticsearch_capture_body_urls option #670

Merged
merged 6 commits into from
Aug 18, 2022
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion specs/agents/tracing-instrumentation-db.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,15 @@ The following fields are relevant for database and datastore spans. Where possib
|`action`| `request` |
| __**context.db._**__ |<hr/>|<hr/>|
|`_.instance`| e.g. `my-cluster` | [Cluster name](#cluster-name), if available.
|`_.statement`| e.g. <pre lang="json">{"query": {"match": {"user.id": "kimchy"}}}</pre> | 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. <pre lang="json">{"query": {"match": {"user.id": "kimchy"}}}</pre> | 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 should be decoded first.|
felixbarny marked this conversation as resolved.
Show resolved Hide resolved
|`_.type`|`elasticsearch`|
|`_.user`| :heavy_minus_sign: |
|`_.link`| :heavy_minus_sign: |
|`_.rows_affected`| :heavy_minus_sign: |
| __**context.http._**__ |<hr/>|<hr/>|
|`_.status_code`|`200`|
|`_.method`|`GET`|
|`_.url`|`https://localhost:9200/index/_search?q=user.id:kimchy`|
| __**context.destination._**__ |<hr/>|<hr/>|
|`_.address`|e.g. `localhost`|
|`_.port`|e.g. `5432`|
Expand All @@ -141,6 +145,19 @@ 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

| Field | Value / Examples | Comments |
Expand Down