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 all 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 initial instrumentation configuration schema

## [v0.2.0] - 2024-05-08

* Document time value units in kitchen-sink example. [#51](https://github.com/open-telemetry/opentelemetry-configuration/pull/51)
Expand Down
104 changes: 104 additions & 0 deletions examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -434,3 +434,107 @@ 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.
#
# Instrumenation may merge general config options with the language specific configuration at .instrumentation.<language>.
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.
#
# Each entry is a key value pair where "peer" defines the IP address and "service" defines the corresponding logical name of the service.
#
# See peer.service semantic conventions: https://opentelemetry.io/docs/specs/semconv/general/attributes/#general-remote-service-attributes
service_mapping:
- 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
# Configure headers to capture for outbound http requests.
request_captured_headers:
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
- Content-Type
- Accept
# Configure headers to capture for outbound http responses.
response_captured_headers:
- Content-Type
- Content-Encoding
# Configure instrumentations following the http server semantic conventions.
server:
# Configure headers to capture for inbound http requests.
request_captured_headers:
- Content-Type
- Accept
# Configure headers to capture for outbound http responses.
response_captured_headers:
- Content-Type
- Content-Encoding
# Configure language-specific instrumentation libraries.
#
# Keys may refer to instrumentation libraries or collections of related configuration. Because there is no central schema defining the keys or their contents, instrumentation must carefully document their schema and avoid key collisions with other instrumentations.
#
# Configure C++ language-specific instrumentation libraries.
cpp:
# Configure the instrumentation corresponding to key "example".
example:
property: "value"
# Configure .NET language-specific instrumentation libraries.
dotnet:
# Configure the instrumentation corresponding to key "example".
example:
property: "value"
# Configure Erlang language-specific instrumentation libraries.
erlang:
# Configure the instrumentation corresponding to key "example".
example:
property: "value"
# Configure Go language-specific instrumentation libraries.
go:
# Configure the instrumentation corresponding to key "example".
example:
property: "value"
# Configure Java language-specific instrumentation libraries.
java:
# Configure the instrumentation corresponding to key "example".
example:
property: "value"
# Configure JavaScript language-specific instrumentation libraries.
js:
# Configure the instrumentation corresponding to key "example".
example:
property: "value"
# Configure PHP language-specific instrumentation libraries.
php:
# Configure the instrumentation corresponding to key "example".
example:
property: "value"
# Configure Python language-specific instrumentation libraries.
python:
# Configure the instrumentation corresponding to key "example".
example:
property: "value"
# Configure Ruby language-specific instrumentation libraries.
ruby:
# Configure the instrumentation corresponding to key "example".
example:
property: "value"
# Configure Rust language-specific instrumentation libraries.
rust:
# Configure the instrumentation corresponding to key "example".
example:
property: "value"
# Configure Swift language-specific instrumentation libraries.
swift:
# Configure the instrumentation corresponding to key "example".
example:
property: "value"
134 changes: 134 additions & 0 deletions schema/instrumentation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"$id": "https://opentelemetry.io/otelconfig/instrumentation.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Instrumentation",
"type": "object",
"additionalProperties": false,
"properties": {
"general": {
"$ref": "#/$defs/GeneralInstrumentation"
},
"cpp": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
},
"dotnet": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
},
"erlang": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
},
"go": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
},
"java": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
},
"js": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
},
"php": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
},
"python": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
},
"ruby": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
},
"rust": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
},
"swift": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
}
},
"patternProperties": {
".*": {
"$ref": "#/$defs/LanguageSpecificInstrumentation"
}
},
"$defs": {
"GeneralInstrumentation": {
"type": "object",
"additionalProperties": false,
"properties": {
"peer": {
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
"type": "object",
"additionalProperties": false,
"properties": {
"service_mapping": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"peer": {
"type": "string"
},
"service": {
"type": "string"
}
},
"required": [
"peer",
"service"
]
}
}
}
},
"http": {
"type": "object",
"additionalProperties": false,
"properties": {
"client": {
"type": "object",
"additionalProperties": false,
"properties": {
"request_captured_headers": {
"type": "array",
"items": {
"type": "string"
}
},
"response_captured_headers": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"server": {
"type": "object",
"additionalProperties": false,
"properties": {
"request_captured_headers": {
"type": "array",
"items": {
"type": "string"
}
},
"response_captured_headers": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
},
"LanguageSpecificInstrumentation": {
"type": "object",
"additionalProperties": true,
"patternProperties": {
".*": {
"type": "object"
}
}
}
}
}
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