diff --git a/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md b/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md new file mode 100644 index 00000000..2525a7fa --- /dev/null +++ b/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md @@ -0,0 +1,27 @@ +# Attributes + + +| Attribute | Type | Description | Examples | Required | +|---|---|---|---|---| +| `http.method` | string | . | `GET` | Yes | +| `http.url` | string | . | `.` | No | +| `http.target` | string | . | `.` | No | +| `http.host` | string | . | `.` | No | +| `http.scheme` | string | . | `http` | No | +| `http.status_code` | int | . | | . | +| `http.user_agent` | string | . | `.` | No | +| [`net.peer.ip`](span-general.md) | string | . | `.` | No | +| [`net.peer.name`](span-general.md) | string | . | `.` | No | +| [`net.peer.port`](span-general.md) | int | . | | No | + +Following attributes MUST be provided **at span creation time** (when provided at all): + +* `http.method` +* `http.url` +* `http.target` +* `http.host` +* `http.scheme` +* [`net.peer.ip`](span-general.md) +* [`net.peer.name`](span-general.md) +* [`net.peer.port`](span-general.md) + diff --git a/semantic-conventions/src/tests/data/markdown/sampling_relevant/general.yaml b/semantic-conventions/src/tests/data/markdown/sampling_relevant/general.yaml new file mode 100644 index 00000000..016be000 --- /dev/null +++ b/semantic-conventions/src/tests/data/markdown/sampling_relevant/general.yaml @@ -0,0 +1,19 @@ +groups: + - id: network + type: span + prefix: net + brief: > + These attributes may be used for any network related operation. + attributes: + - id: peer.ip + type: string + brief: . + examples: '.' + - id: peer.port + type: int + brief: . + examples: [] + - id: peer.name + type: string + brief: . + examples: '.' diff --git a/semantic-conventions/src/tests/data/markdown/sampling_relevant/http.yaml b/semantic-conventions/src/tests/data/markdown/sampling_relevant/http.yaml new file mode 100644 index 00000000..cfaf7c3b --- /dev/null +++ b/semantic-conventions/src/tests/data/markdown/sampling_relevant/http.yaml @@ -0,0 +1,49 @@ +groups: + - id: http + prefix: http + brief: 'This document defines semantic conventions for HTTP client and server Spans.' + attributes: + - id: method + type: string + required: always + brief: . + sampling_relevant: true + examples: ["GET"] + - id: url + type: string + brief: . + sampling_relevant: true + examples: ['.'] + - id: target + type: string + brief: . + sampling_relevant: true + examples: ['.'] + - id: host + type: string + brief: . + sampling_relevant: true + examples: ['.'] + - id: scheme + type: string + brief: . + sampling_relevant: true + examples: ["http"] + - id: status_code + type: int + required: + conditional: . + brief: . + examples: [] + - id: user_agent + type: string + brief: . + examples: ['.'] + - ref: net.peer.name + sampling_relevant: true + - ref: net.peer.ip + sampling_relevant: true + - ref: net.peer.port + sampling_relevant: true + constraints: + - include: network \ No newline at end of file diff --git a/semantic-conventions/src/tests/data/markdown/sampling_relevant/input.md b/semantic-conventions/src/tests/data/markdown/sampling_relevant/input.md new file mode 100644 index 00000000..7672e906 --- /dev/null +++ b/semantic-conventions/src/tests/data/markdown/sampling_relevant/input.md @@ -0,0 +1,5 @@ +# Attributes + + + + diff --git a/semantic-conventions/src/tests/data/markdown/sampling_relevant/span-general.md b/semantic-conventions/src/tests/data/markdown/sampling_relevant/span-general.md new file mode 100644 index 00000000..12f767fa --- /dev/null +++ b/semantic-conventions/src/tests/data/markdown/sampling_relevant/span-general.md @@ -0,0 +1,5 @@ +# General + + + + \ No newline at end of file diff --git a/semantic-conventions/src/tests/semconv/templating/test_markdown.py b/semantic-conventions/src/tests/semconv/templating/test_markdown.py index c746d83c..cfebdba8 100644 --- a/semantic-conventions/src/tests/semconv/templating/test_markdown.py +++ b/semantic-conventions/src/tests/semconv/templating/test_markdown.py @@ -117,6 +117,9 @@ def test_units(self): def test_event(self): self.check("markdown/event/") + def testSamplingRelevant(self): + self.check("markdown/sampling_relevant/") + def check( self, input_dir: str,