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

Add scope configuration properties #140

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
52 changes: 51 additions & 1 deletion examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,23 @@ logger_provider:
attribute_value_length_limit: 4096
# Configure max attribute count. Overrides .attribute_limits.attribute_count_limit.
attribute_count_limit: 128
# Configure loggers.
logger_configurator:
# Configure the default logger config used there is no matching entry in .logger_configurator.loggers.
default_config:
# Configure if the logger is enabled or not.
disabled: true
# Configure loggers.
loggers:
- # Configure logger names to match, evaluated as follows:
#
# * If the logger name exactly matches.
# * If the logger name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
name: io.opentelemetry.contrib.*
# The logger config.
config:
# Configure if the logger is enabled or not.
disabled: false

# Configure meter provider.
meter_provider:
Expand Down Expand Up @@ -217,6 +234,23 @@ meter_provider:
- key3
# Configure the exemplar filter. Known values include: trace_based, always_on, always_off.
exemplar_filter: trace_based
# Configure meters.
meter_configurator:
# Configure the default meter config used there is no matching entry in .meter_configurator.meters.
default_config:
# Configure if the meter is enabled or not.
disabled: true
# Configure meters.
meters:
- # Configure meter names to match, evaluated as follows:
#
# * If the meter name exactly matches.
# * If the meter name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
name: io.opentelemetry.contrib.*
# The meter config.
config:
# Configure if the meter is enabled or not.
disabled: false

# Configure text map context propagators.
propagator:
Expand Down Expand Up @@ -320,7 +354,23 @@ tracer_provider:
local_parent_not_sampled:
# Configure sampler to be always_off.
always_off:

# Configure tracers.
tracer_configurator:
# Configure the default tracer config used there is no matching entry in .tracer_configurator.tracers.
default_config:
# Configure if the tracer is enabled or not.
disabled: true
# Configure tracers.
tracers:
- # Configure tracer names to match, evaluated as follows:
#
# * If the tracer name exactly matches.
# * If the tracer name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
name: io.opentelemetry.contrib.*
# The tracer config.
config:
# Configure if the tracer is enabled or not.
disabled: false

# Configure resource for all signals.
resource:
Expand Down
42 changes: 42 additions & 0 deletions schema/logger_provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"limits": {
"$ref": "#/$defs/LogRecordLimits"
},
"logger_configurator": {
"$ref": "#/$defs/LoggerConfigurator"
}
},
"$defs": {
Expand Down Expand Up @@ -107,6 +110,45 @@
"type": ["object", "null"]
}
}
},
"LoggerConfigurator": {
"type": ["object", "null"],
"additionalProperties": false,
"title": "LoggerConfigurator",
"properties": {
"default_config": {
"$ref": "#/$defs/LoggerConfig"
},
"loggers": {
"type": "array",
"items": {
"$ref": "#/$defs/LoggerMatcherAndConfig"
}
}
}
},
"LoggerMatcherAndConfig": {
"type": ["object", "null"],
"additionalProperties": false,
"title": "LoggerMatcherAndConfig",
"properties": {
"name": {
"type": ["string", "null"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"type": ["string", "null"]
"type": ["string"]

},
"config": {
"$ref": "#/$defs/LoggerConfig"
}
}
},
"LoggerConfig": {
"type": ["object", "null"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"type": ["object", "null"],
"type": ["object"],

"additionalProperties": false,
"title": "LoggerConfig",
"properties": {
"disabled": {
"type": ["boolean", "null"]
}
}
}
}
}
42 changes: 42 additions & 0 deletions schema/meter_provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"always_off",
"trace_based"
]
},
"meter_configurator": {
"$ref": "#/$defs/MeterConfigurator"
}
},
"$defs": {
Expand Down Expand Up @@ -321,6 +324,45 @@
}
}
}
},
"MeterConfigurator": {
"type": ["object", "null"],
"additionalProperties": false,
"title": "MeterConfigurator",
"properties": {
"default_config": {
"$ref": "#/$defs/MeterConfig"
},
"meters": {
"type": "array",
"items": {
"$ref": "#/$defs/MeterMatcherAndConfig"
}
}
}
},
"MeterMatcherAndConfig": {
"type": ["object", "null"],
"additionalProperties": false,
"title": "MeterMatcherAndConfig",
"properties": {
"name": {
"type": ["string", "null"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"type": ["string", "null"]
"type": ["string"]

},
"config": {
"$ref": "#/$defs/MeterConfig"
}
}
},
"MeterConfig": {
"type": ["object", "null"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"type": ["object", "null"],
"type": ["object"],

"additionalProperties": false,
"title": "MeterConfig",
"properties": {
"disabled": {
"type": ["boolean", "null"]
}
}
}
}
}
42 changes: 42 additions & 0 deletions schema/tracer_provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
},
"sampler": {
"$ref": "#/$defs/Sampler"
},
"tracer_configurator": {
"$ref": "#/$defs/TracerConfigurator"
}
},
"$defs": {
Expand Down Expand Up @@ -215,6 +218,45 @@
"endpoint"
],
"title": "Zipkin"
},
"TracerConfigurator": {
"type": ["object", "null"],
"additionalProperties": false,
"title": "TracerConfigurator",
"properties": {
"default_config": {
"$ref": "#/$defs/TracerConfig"
},
"tracers": {
"type": "array",
"items": {
"$ref": "#/$defs/TracerMatcherAndConfig"
}
}
}
},
"TracerMatcherAndConfig": {
"type": ["object", "null"],
"additionalProperties": false,
"title": "TracerMatcherAndConfig",
"properties": {
"name": {
"type": ["string"]
},
"config": {
"$ref": "#/$defs/TracerConfig"
}
}
},
"TracerConfig": {
"type": ["object"],
"additionalProperties": false,
"title": "TracerConfig",
"properties": {
"disabled": {
"type": ["boolean", "null"]
}
}
}
}
}
78 changes: 78 additions & 0 deletions schema/type_descriptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
property_descriptions:
processors: Configure log record processors.
limits: Configure log record limits. See also attribute_limits.
logger_configurator: Configure loggers.
path_patterns:
- .logger_provider

Expand Down Expand Up @@ -126,6 +127,31 @@
attribute_count_limit: Configure max attribute count. Overrides .attribute_limits.attribute_count_limit.
path_patterns:
- .logger_provider.limits

- type: LoggerConfigurator
property_descriptions:
default_config: Configure the default logger config used there is no matching entry in .logger_configurator.loggers.
loggers: Configure loggers.
path_patterns:
- .logger_provider.logger_configurator

- type: LoggerConfigAndMatcher
property_descriptions:
name: >
Configure logger names to match, evaluated as follows:

* If the logger name exactly matches.
* If the logger name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
config: The logger config.
path_patterns:
- .logger_provider.logger_configurator.loggers[]

- type: LoggerConfig
property_descriptions:
disabled: Configure if the logger is enabled or not.
path_patterns:
- .logger_provider.logger_configurator.default_config
- .logger_provider.logger_configurator.loggers[].config
# END LoggerProvider

# START TracerProvider
Expand All @@ -134,6 +160,7 @@
processors: Configure span processors.
limits: Configure span limits. See also attribute_limits.
sampler: Configure the sampler.
tracer_configurator: Configure tracers.
path_patterns:
- .tracer_provider

Expand Down Expand Up @@ -201,6 +228,31 @@
path_patterns:
- .tracer_provider.sampler
- .tracer_provider.sampler.*

- type: TracerConfigurator
property_descriptions:
default_config: Configure the default tracer config used there is no matching entry in .tracer_configurator.tracers.
tracers: Configure tracers.
path_patterns:
- .tracer_provider.tracer_configurator

- type: TracerConfigAndMatcher
property_descriptions:
name: >
Configure tracer names to match, evaluated as follows:

* If the tracer name exactly matches.
* If the tracer name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
config: The tracer config.
path_patterns:
- .tracer_provider.tracer_configurator.tracers[]

- type: TracerConfig
property_descriptions:
disabled: Configure if the tracer is enabled or not.
path_patterns:
- .tracer_provider.tracer_configurator.default_config
- .tracer_provider.tracer_configurator.tracers[].config
# END TracerProvider

# START MeterProvider
Expand All @@ -209,6 +261,7 @@
readers: Configure metric readers.
views: Configure views. Each view has a selector which determines the instrument(s) it applies to, and a configuration for the resulting stream(s).
exemplar_filter: "Configure the exemplar filter. Known values include: trace_based, always_on, always_off."
meter_configurator: Configure meters.
path_patterns:
- .meter_provider

Expand Down Expand Up @@ -325,6 +378,31 @@
record_min_max: Configure record min and max.
path_patterns:
- .meter_provider.views[].stream.aggregation.explicit_bucket_histogram

- type: MeterConfigurator
property_descriptions:
default_config: Configure the default meter config used there is no matching entry in .meter_configurator.meters.
meters: Configure meters.
path_patterns:
- .meter_provider.meter_configurator

- type: MeterConfigAndMatcher
property_descriptions:
name: >
Configure meter names to match, evaluated as follows:

* If the meter name exactly matches.
* If the meter name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
config: The meter config.
path_patterns:
- .meter_provider.meter_configurator.meters[]

- type: MeterConfig
property_descriptions:
disabled: Configure if the meter is enabled or not.
path_patterns:
- .meter_provider.meter_configurator.default_config
- .meter_provider.meter_configurator.meters[].config
# END meter_provider

# START common
Expand Down
Loading