Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Sep 17, 2021
1 parent c2817c8 commit cb3a13e
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Attributes

<!-- semconv http -->
| 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)
<!-- endsemconv -->
Original file line number Diff line number Diff line change
@@ -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: '.'
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Attributes

<!-- semconv http -->

<!-- endsemconv -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# General

<!-- semconv network -->

<!-- endsemconv -->
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cb3a13e

Please sign in to comment.