Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding instrumentation configuration #91

Merged
merged 13 commits into from
Jun 17, 2024
Merged
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
brettmc marked this conversation as resolved.
Show resolved Hide resolved
instrumentation:
# Configure options common to multiple languages
common:
peer-service-mapping:
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
- peer: foo
service: bar
- peer: bar
service: bat
http-capture-headers:
client:
brettmc marked this conversation as resolved.
Show resolved Hide resolved
request:
- X-Foo
response:
- X-Foo-*
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
server:
request:
- X-Bar-*
response:
- X-Bar
db-statement-sanitizer:
enabled: true
foo: bar
# Configure language-specific module options
java:
logback-appender:
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
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": {
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
"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": {},
brettmc marked this conversation as resolved.
Show resolved Hide resolved
"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
Loading