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
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
65 changes: 65 additions & 0 deletions examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,68 @@ resource:
- process.command_args
# Configure the resource schema URL.
schema_url: https://opentelemetry.io/schemas/1.16.0
# Configure instrumentation.
instrumentation:
# Configure general SemConv options that may apply to multiple languages and instrumentations.
general:
# Configure instrumentations following the peer semantic conventions.
#
# See peer semantic conventions: https://opentelemetry.io/docs/specs/semconv/attributes-registry/peer/
peer:
brettmc marked this conversation as resolved.
Show resolved Hide resolved
# Configure the service mapping for instrumentations following peer.service semantic conventions.
#
# See peer.service semantic conventions: https://opentelemetry.io/docs/specs/semconv/general/attributes/#general-remote-service-attributes
service-mapping:
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
brettmc marked this conversation as resolved.
Show resolved Hide resolved
- peer: 1.2.3.4
service: FooService
- peer: 2.3.4.5
service: BarService
# Configure instrumentations following the http semantic conventions.
#
# See http semantic conventions: https://opentelemetry.io/docs/specs/semconv/http/
http:
brettmc marked this conversation as resolved.
Show resolved Hide resolved
# Configure instrumentations following the http client semantic conventions.
client:
brettmc marked this conversation as resolved.
Show resolved Hide resolved
request:
capture-headers:
- X-Foo
response:
capture-headers:
- X-Foo
# Configure instrumentations following the http server semantic conventions.
server:
request:
capture-headers:
- X-Bar
response:
capture-headers:
- X-Bar
# Configure instrumentations following the db semantic conventions.
#
# See db semantic conventions: https://opentelemetry.io/docs/specs/semconv/database/
db:
# Configure database statement sanitization.
#
# See https://opentelemetry.io/docs/specs/semconv/database/database-spans/#common-attributes
statement-sanitizer:
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
enabled: true
# Language-specific module options
java:
# Configure Java's Logback Appender instrumentation.
#
# See https://opentelemetry.io/docs/languages/java/automatic/spring-boot/#logback
logback-appender:
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
experimental-log-attributes: true
experimental:
capture-code-attributes: true
capture-marker-attribute: false
capture-key-value-pair-attributes: true
capture-logger-context-attributes: false
capture-mdc-attributes:
- attr_one
- attr_two
php:
# Configure PHP's example instrumentation.
example_instrumentation:
span_name: test123
enabled: true
146 changes: 146 additions & 0 deletions schema/instrumentation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{
"$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"
}
}
}
}
}
}
},
"android": {
"$ref": "#/$defs/AndroidModules"
},
"cpp": {
"$ref": "#/$defs/CppModules"
},
"dotnet": {
"$ref": "#/$defs/DotnetModules"
},
"erlang": {
"$ref": "#/$defs/ErlangModules"
},
"go": {
"$ref": "#/$defs/GoModules"
},
"java": {
"$ref": "#/$defs/JavaModules"
},
"js": {
"$ref": "#/$defs/JsModules"
},
"php": {
"$ref": "#/$defs/PhpModules"
},
"python": {
"$ref": "#/$defs/PythonModules"
},
"ruby": {
"$ref": "#/$defs/RubyModules"
},
"rust": {
"$ref": "#/$defs/RustModules"
},
"swift": {
"$ref": "#/$defs/SwiftModules"
}
},
"$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"
}
},
"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"
}
}
},
"AndroidModules": {},
"CppModules": {},
"DotnetModules": {},
"ErlangModules": {},
"GoModules": {},
"JavaModules": {},
brettmc marked this conversation as resolved.
Show resolved Hide resolved
"JsModules": {},
"PhpModules": {},
"PythonModules": {},
"RubyModules": {},
"RustModules": {},
"SwiftModules": {}
}
}
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