Skip to content

Commit

Permalink
organise general instrumentation config by semconv
Browse files Browse the repository at this point in the history
  • Loading branch information
brettmc committed May 21, 2024
1 parent 188d2c6 commit 13e4b16
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 35 deletions.
37 changes: 21 additions & 16 deletions examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -428,28 +428,33 @@ resource:
schema_url: https://opentelemetry.io/schemas/1.16.0
# Configure instrumentation
instrumentation:
# Configure options common to multiple languages
common:
peer-service-mapping:
- peer: foo
service: bar
- peer: bar
service: bat
http-capture-headers:
# General SemConv options that may apply to multiple languages
general:
peer:
service-mapping:
- peer: foo
service: bar
- peer: bar
service: bat
http:
client:
request:
- X-Foo
capture-headers:
- X-Foo
response:
- X-Foo-*
capture-headers:
- X-Foo
server:
request:
- X-Bar-*
capture-headers:
- X-Bar
response:
- X-Bar
db-statement-sanitizer:
enabled: true
foo: bar
# Configure language-specific module options
capture-headers:
- X-Bar
db:
statement-sanitizer:
enabled: true
# Language-specific module options
java:
logback-appender:
experimental:
Expand Down
60 changes: 41 additions & 19 deletions schema/instrumentation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,47 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Instrumentation",
"type": "object",
"additionalProperties": true,
"additionalProperties": false,
"properties": {
"common": {
"general": {
"type": "object",
"additionalProperties": false,
"properties": {
"peer-service-mapping": {
"type": "array",
"items": {
"$ref": "#/$defs/PeerServiceMapping"
"peer": {
"type": "object",
"properties": {
"service-mapping": {
"type": "array",
"items": {
"$ref": "#/$defs/PeerServiceMapping"
}
}
}
},
"http-capture-headers": {
"http": {
"type": "object",
"additionalProperties": false,
"properties": {
"client": {
"$ref": "#/$defs/RequestResponseHeaders"
"$ref": "#/$defs/RequestResponseCaptureHeaders"
},
"server": {
"$ref": "#/$defs/RequestResponseHeaders"
"$ref": "#/$defs/RequestResponseCaptureHeaders"
}
},
"additionalProperties": false
}
},
"db-statement-sanitizer": {
"db": {
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean"
"statement-sanitizer": {
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean"
}
}
}
}
}
Expand Down Expand Up @@ -72,17 +85,26 @@
"type": "string"
}
},
"RequestResponseHeaders": {
"CaptureHeaders": {
"type": "object",
"additionalProperties": false,
"properties": {
"request": {
"capture-headers": {
"$ref": "#/$defs/ArrayOfHeaders"
}
}
},
"RequestResponseCaptureHeaders": {
"type": "object",
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/$defs/CaptureHeaders"
},
"response": {
"$ref": "#/$defs/ArrayOfHeaders"
"$ref": "#/$defs/CaptureHeaders"
}
},
"additionalProperties": false
}
},
"JavaModules": {},
"JsModules": {},
Expand Down

0 comments on commit 13e4b16

Please sign in to comment.