From a0fa771497b11dff3ea9bb8e9c918e46f706a14e Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Thu, 6 Apr 2023 14:04:22 +0200 Subject: [PATCH] Updates based on review --- semantic_conventions/trace/database.yaml | 17 +++++++---------- .../instrumentation/elasticsearch.md | 16 ++++++++-------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/semantic_conventions/trace/database.yaml b/semantic_conventions/trace/database.yaml index 8b87ac98933..6fb1b19c6d3 100644 --- a/semantic_conventions/trace/database.yaml +++ b/semantic_conventions/trace/database.yaml @@ -397,10 +397,10 @@ groups: brief: > The document that the request targets. examples: [ '123', '456' ] - - id: params + - id: url.query type: string requirement_level: - conditionally_required: when params are provided as part of the request + conditionally_required: when query params are provided as part of the request tag: call-level-tech-specific brief: > The query params of the request, as a json string. @@ -413,20 +413,16 @@ groups: brief: > The name of the data stream or index that is targeted. examples: [ 'users' ] - - id: url + - id: url.path type: string requirement_level: required tag: call-level-tech-specific brief: > - The url of the request, including the target and exact document id. + The path of the request, including the target and exact document id. examples: [ '/test-index/_search', '/test-index/_doc/123' ] - - id: method - type: string + - ref: http.method requirement_level: required - tag: call-level-tech-specific - brief: > - The HTTP method of the request. - examples: [ 'GET', 'PUT' ] + - id: db.sql prefix: 'db.sql' type: span @@ -559,3 +555,4 @@ groups: - include: 'db.mongodb' - include: 'db.sql' - include: 'db.cosmosdb' + - include: 'db.elasticsearch' diff --git a/specification/trace/semantic_conventions/instrumentation/elasticsearch.md b/specification/trace/semantic_conventions/instrumentation/elasticsearch.md index 08a637c0d68..c3248a53ff5 100644 --- a/specification/trace/semantic_conventions/instrumentation/elasticsearch.md +++ b/specification/trace/semantic_conventions/instrumentation/elasticsearch.md @@ -18,14 +18,14 @@ When there is no target or document id, the span name will contain the exact url ### Span attributes -| Attribute | Type | Description | Examples | Requirement Level | -|---------------------------|---|---------------------------------------------------------------------|---------------------------------------------------------|------------------------| -| `db.elasticsearch.doc_id` | string | The document that the request targets, specified in the path. | `'123'` | Conditionally Required | -| `db.elasticsearch.params` | string | The query params of the request, as a json string. | `'"{\"q\":\"test\"}", "{\"refresh\":true}"'` | Conditionally Required | -| `db.elasticsearch.target` | string | The name of the data stream or index that is targeted. | `'users'` | Conditionally Required | -| `db.elasticsearch.url` | string | The exact url of the request, including the target and document id. | `'/test-index/_doc/123'` | Required | -| `db.elasticsearch.method` | string | The HTTP method of the request. | `'GET'` | Required | -| `db.statement` | string | The request body, as a json string. [1] | `"{\"name\":\"TestUser\",\"password\":\"top_secret\"}"` | Conditionally Required | +| Attribute | Type | Description | Examples | Requirement Level | +|----------------------------|---|----------------------------------------------------------------------|---------------------------------------------------------|------------------------| +| `db.elasticsearch.doc_id` | string | The document that the request targets, specified in the path. | `'123'` | Conditionally Required | +| `db.elasticsearch.target` | string | The name of the data stream or index that is targeted. | `'users'` | Conditionally Required | +| `db.elasticsearch.url.path` | string | The exact path of the request, including the target and document id. | `'/test-index/_doc/123'` | Required | +| `db.elasticsearch.url.query` | string | The query params of the request, as a json string. | `'"{\"q\":\"test\"}", "{\"refresh\":true}"'` | Conditionally Required | +| `db.statement` | string | The request body, as a json string. [1] | `"{\"name\":\"TestUser\",\"password\":\"top_secret\"}"` | Conditionally Required | +| `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | **[1]:** The value may be sanitized to exclude sensitive information.