Skip to content

Commit

Permalink
adding instrumentation configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
brettmc committed May 20, 2024
1 parent 28fe6c3 commit 188d2c6
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

* Adding Instrumentation configuration

## v0.1.0 - 2023-10-05

Initial configuration schema release, including:
Expand Down
34 changes: 34 additions & 0 deletions examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,37 @@ resource:
- process.command_args
# Configure the resource schema URL.
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:
client:
request:
- X-Foo
response:
- X-Foo-*
server:
request:
- X-Bar-*
response:
- X-Bar
db-statement-sanitizer:
enabled: true
foo: bar
# Configure language-specific module options
java:
logback-appender:
experimental:
capture-mdc-attributes:
- attr_one
- attr_two
php:
example_instrumentation:
span_name: test123
enabled: true
92 changes: 92 additions & 0 deletions schema/instrumentation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"$id": "https://opentelemetry.io/otelconfig/instrumentation.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Instrumentation",
"type": "object",
"additionalProperties": true,
"properties": {
"common": {
"type": "object",
"properties": {
"peer-service-mapping": {
"type": "array",
"items": {
"$ref": "#/$defs/PeerServiceMapping"
}
},
"http-capture-headers": {
"type": "object",
"properties": {
"client": {
"$ref": "#/$defs/RequestResponseHeaders"
},
"server": {
"$ref": "#/$defs/RequestResponseHeaders"
}
},
"additionalProperties": false
},
"db-statement-sanitizer": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
}
}
}
},
"java": {
"$ref": "#/$defs/JavaModules"
},
"js": {
"$ref": "#/$defs/JsModules"
},
"php": {
"$ref": "#/$defs/PhpModules"
},
"python": {
"$ref": "#/$defs/PythonModules"
}
},
"$defs": {
"PeerServiceMapping": {
"type": "object",
"additionalProperties": false,
"properties": {
"peer": {
"type": "string"
},
"service": {
"type": "string"
}
},
"required": [
"peer",
"service"
]
},
"ArrayOfHeaders": {
"type": "array",
"items": {
"type": "string"
}
},
"RequestResponseHeaders": {
"type": "object",
"properties": {
"request": {
"$ref": "#/$defs/ArrayOfHeaders"
},
"response": {
"$ref": "#/$defs/ArrayOfHeaders"
}
},
"additionalProperties": false
},
"JavaModules": {},
"JsModules": {},
"PhpModules": {},
"PythonModules": {}
}
}
3 changes: 3 additions & 0 deletions schema/opentelemetry_configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
},
"resource": {
"$ref": "resource.json"
},
"instrumentation": {
"$ref": "instrumentation.json"
}
},
"required": [
Expand Down

0 comments on commit 188d2c6

Please sign in to comment.