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
39 changes: 39 additions & 0 deletions examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,42 @@ resource:
- process.command_args
# Configure the resource schema URL.
schema_url: https://opentelemetry.io/schemas/1.16.0
# Configure instrumentation
instrumentation:
# General SemConv options that may apply to multiple languages
general:
peer:
service-mapping:
- peer: 1.2.3.4
service: FooService
- peer: 2.3.4.5
service: BarService
http:
client:
request:
capture-headers:
- X-Foo
response:
capture-headers:
- X-Foo
server:
request:
capture-headers:
- X-Bar
response:
capture-headers:
- X-Bar
db:
statement-sanitizer:
enabled: true
# Language-specific module options
java:
logback-appender:
experimental:
capture-mdc-attributes:
- attr_one
- attr_two
php:
example_instrumentation:
span_name: test123
enabled: true
114 changes: 114 additions & 0 deletions schema/instrumentation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"$id": "https://opentelemetry.io/otelconfig/instrumentation.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Instrumentation",
"type": "object",
"additionalProperties": false,
"properties": {
"general": {
"type": "object",
"additionalProperties": false,
"properties": {
"peer": {
"type": "object",
"properties": {
"service-mapping": {
"type": "array",
"items": {
"$ref": "#/$defs/PeerServiceMapping"
}
}
}
},
"http": {
"type": "object",
"additionalProperties": false,
"properties": {
"client": {
"$ref": "#/$defs/RequestResponseCaptureHeaders"
},
"server": {
"$ref": "#/$defs/RequestResponseCaptureHeaders"
}
}
},
"db": {
"type": "object",
"additionalProperties": false,
"properties": {
"statement-sanitizer": {
"type": "object",
"additionalProperties": false,
"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"
}
},
"CaptureHeaders": {
"type": "object",
"additionalProperties": false,
"properties": {
"capture-headers": {
"$ref": "#/$defs/ArrayOfHeaders"
}
}
},
"RequestResponseCaptureHeaders": {
"type": "object",
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/$defs/CaptureHeaders"
},
"response": {
"$ref": "#/$defs/CaptureHeaders"
}
}
},
"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
Loading