-
Notifications
You must be signed in to change notification settings - Fork 214
update declarative config to 1.0-rc.2 #1733
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace OpenTelemetry\Config\SDK\ComponentProvider\Detector; | ||
|
|
||
| use OpenTelemetry\API\Configuration\Config\ComponentProvider; | ||
| use OpenTelemetry\API\Configuration\Config\ComponentProviderRegistry; | ||
| use OpenTelemetry\API\Configuration\Context; | ||
| use OpenTelemetry\SDK\Resource\Detectors\Service as ServiceDetector; | ||
| use OpenTelemetry\SDK\Resource\ResourceDetectorInterface; | ||
| use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; | ||
| use Symfony\Component\Config\Definition\Builder\NodeBuilder; | ||
|
|
||
| /** | ||
| * @implements ComponentProvider<ResourceDetectorInterface> | ||
| */ | ||
| final class Service implements ComponentProvider | ||
| { | ||
| /** | ||
| * @param array{} $properties | ||
| */ | ||
| #[\Override] | ||
| public function createPlugin(array $properties, Context $context): ResourceDetectorInterface | ||
| { | ||
| return new ServiceDetector(); | ||
| } | ||
|
|
||
| #[\Override] | ||
| public function getConfig(ComponentProviderRegistry $registry, NodeBuilder $builder): ArrayNodeDefinition | ||
| { | ||
| return $builder->arrayNode('service'); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,7 @@ final class OpenTelemetrySdk implements ComponentProvider | |
| { | ||
| /** | ||
| * @param array{ | ||
| * file_format: '0.4', | ||
| * file_format: '1.0-rc.2', | ||
| * disabled: bool, | ||
| * resource: array{ | ||
| * attributes: array{ | ||
|
|
@@ -409,7 +409,7 @@ public function getConfig(ComponentProviderRegistry $registry, NodeBuilder $buil | |
| ->isRequired() | ||
| ->example('0.1') | ||
| ->validate()->always(Validation::ensureString())->end() | ||
| ->validate()->ifNotInArray(['0.4'])->thenInvalid('unsupported version')->end() | ||
| ->validate()->ifNotInArray(['1.0-rc.2'])->thenInvalid('unsupported version')->end() | ||
| ->end() | ||
| ->booleanNode('disabled')->defaultFalse()->end() | ||
| ->append($this->getResourceConfig($registry, $builder)) | ||
|
|
@@ -510,11 +510,11 @@ private function getTracerProviderConfig(ComponentProviderRegistry $registry, No | |
| ->arrayNode('tracers') | ||
| ->arrayPrototype() | ||
| ->children() | ||
| ->scalarNode('name')->isRequired()->cannotBeEmpty()->end() | ||
| ->scalarNode('name')->end() | ||
| ->arrayNode('config') | ||
| ->addDefaultsIfNotSet() | ||
| ->children() | ||
| ->booleanNode('disabled')->isRequired()->end() | ||
| ->booleanNode('disabled')->end() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should also remove |
||
| ->end() | ||
| ->end() | ||
| ->end() | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -70,6 +70,7 @@ public function getConfig(ComponentProviderRegistry $registry, NodeBuilder $buil | |||||||||||||||||||||
| ->end() | ||||||||||||||||||||||
| ->end() | ||||||||||||||||||||||
| ->end() | ||||||||||||||||||||||
| ->scalarNode('translation_strategy')->defaultValue('UnderscoreEscapingWithSuffixes')->end() | ||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should remove Iff we want to be explicit about the allowed values:
Suggested change
|
||||||||||||||||||||||
| ->end() | ||||||||||||||||||||||
| ; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| file_format: '0.4' | ||
| file_format: '1.0-rc.2' | ||
|
|
||
| propagators: | ||
| composite: [ tracecontext, baggage ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |
| # The file format version. | ||
| # The yaml format is documented at | ||
| # https://github.com/open-telemetry/opentelemetry-configuration/tree/main/schema | ||
| file_format: "0.4" | ||
| file_format: "1.0-rc.2" | ||
| # Configure if the SDK is disabled or not. | ||
| # If omitted or null, false is used. | ||
| disabled: false | ||
|
|
@@ -200,12 +200,6 @@ meter_provider: | |
| # Configure port. | ||
| # If omitted or null, 9464 is used. | ||
| port: 9464 | ||
| # Configure Prometheus Exporter to produce metrics without a unit suffix or UNIT metadata. | ||
| # If omitted or null, false is used. | ||
| without_units: false | ||
| # Configure Prometheus Exporter to produce metrics without a type suffix. | ||
| # If omitted or null, false is used. | ||
| without_type_suffix: false | ||
| # Configure Prometheus Exporter to produce metrics without a scope info metric. | ||
| # If omitted or null, false is used. | ||
| without_scope_info: false | ||
|
|
@@ -225,6 +219,15 @@ meter_provider: | |
| # If omitted, .included resource attributes are included. | ||
| excluded: | ||
| - "service.attr1" | ||
| # Configure how Prometheus metrics are exposed. Values include: | ||
| # | ||
| # * UnderscoreEscapingWithSuffixes, the default. This fully escapes metric names for classic Prometheus metric name compatibility, and includes appending type and unit suffixes. | ||
| # * UnderscoreEscapingWithoutSuffixes, metric names will continue to escape special characters to _, but suffixes won't be attached. | ||
| # * NoUTF8EscapingWithSuffixes will disable changing special characters to _. Special suffixes like units and _total for counters will be attached. | ||
| # * NoTranslation. This strategy bypasses all metric and label name translation, passing them through unaltered. | ||
| # | ||
| # If omitted or null, UnderscoreEscapingWithSuffixes is used. | ||
| translation_strategy: UnderscoreEscapingWithSuffixes | ||
| # Configure metric producers. | ||
| producers: | ||
| - # Configure metric producer to be opencensus. | ||
|
|
@@ -459,7 +462,7 @@ meter_provider: | |
| meter_version: 1.0.0 | ||
| # Configure meter schema url selection criteria. | ||
| # If omitted or null, all meter schema URLs match. | ||
| meter_schema_url: https://opentelemetry.io/schemas/1.30.0 | ||
| meter_schema_url: https://opentelemetry.io/schemas/1.32.0 | ||
| # Configure view stream. | ||
| stream: | ||
| # Configure metric name of the resulting stream(s). | ||
|
|
@@ -557,18 +560,6 @@ propagator: | |
| # Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party identifiers include: xray. | ||
| # If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used. | ||
| composite_list: "tracecontext,baggage,b3,b3multi,jaeger,ottrace,xray" | ||
| # Configure response propagators. | ||
| # If omitted, a noop response propagator is used. | ||
| response_propagator/development: | ||
| # Configure the experimental response propagators in the composite experimental response propagator. Entries from .composite_list are appended to the list here with duplicates filtered out. | ||
| # Built-in experimental response propagator keys include: N/A. Known third party keys include: servertiming, traceresponse. | ||
| # If the resolved list of experimental response propagators (from .composite and .composite_list) is empty, a noop response propagator is used. | ||
| composite: | ||
| # Configure the experimental response propagators in the composite experimental response propagator. Entries are appended to .composite with duplicates filtered out. | ||
| # The value is a comma separated list of experimental response propagator identifiers matching the format of OTEL_EXPERIMENTAL_RESPONSE_PROPAGATORS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details. | ||
| # Built-in experimental propagator identifiers include: N/A. Known third party identifiers include: servertiming, traceresponse. | ||
| # If the resolved list of experimental propagators (from .composite and .composite_list) is empty, a noop response propagator is used. | ||
| composite_list: "servertiming,traceresponse" | ||
|
Comment on lines
-560
to
-571
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might want to undo this change as this is a PHP-specific node. |
||
| # Configure tracer provider. | ||
| # If omitted, a noop tracer provider is used. | ||
| tracer_provider: | ||
|
|
@@ -851,18 +842,14 @@ resource: | |
| # Resource detector names are dependent on the SDK language ecosystem. Please consult documentation for each respective language. | ||
| # If omitted or null, no resource detectors are enabled. | ||
| detectors: | ||
| - # Enable the container resource detector. | ||
| # Note, the key "container" is an example and detector names may vary by SDK language ecosystem. | ||
| - # Enable the container resource detector, which populates container.* attributes. | ||
| container: | ||
| - # Enable the host resource detector. | ||
| # Note, the key "host" is an example and detector names may vary by SDK language ecosystem. | ||
| - # Enable the host resource detector, which populates host.* and os.* attributes. | ||
| host: | ||
| - # Enable the os resource detector. | ||
| # Note, the key "os" is an example and detector names may vary by SDK language ecosystem. | ||
| os: | ||
| - # Enable the process resource detector. | ||
| # Note, the key "process" is an example and detector names may vary by SDK language ecosystem. | ||
| - # Enable the process resource detector, which populates process.* attributes. | ||
| process: | ||
| - # Enable the service detector, which populates service.name based on the OTEL_SERVICE_NAME environment variable and service.instance.id. | ||
| service: | ||
| # Configure resource schema URL. | ||
| # If omitted or null, no schema URL is used. | ||
| schema_url: https://opentelemetry.io/schemas/1.32.0 | ||
|
|
@@ -960,4 +947,4 @@ instrumentation/development: | |
| swift: | ||
| # Configure the instrumentation corresponding to key "example". | ||
| example: | ||
| property: "value" | ||
| property: "value" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| # this is the minimal acceptable configuration file | ||
| file_format: '0.4' | ||
| file_format: '1.0-rc.2' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| file_format: '0.4' | ||
| file_format: '1.0-rc.2' | ||
|
|
||
| propagator: | ||
| composite_list: "tracecontext,tracecontext" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| file_format: '0.4' | ||
| file_format: '1.0-rc.2' | ||
|
|
||
| resource: | ||
| schema_url: https://opentelemetry.io/schemas/1.32.0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| file_format: '0.4' | ||
| file_format: '1.0-rc.2' | ||
|
|
||
| resource: | ||
| schema_url: https://opentelemetry.io/schemas/1.32.0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| file_format: '0.4' | ||
| file_format: '1.0-rc.2' | ||
|
|
||
| resource: | ||
| schema_url: https://opentelemetry.io/schemas/1.32.0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| file_format: '0.4' | ||
| file_format: '1.0-rc.2' | ||
|
|
||
| tracer_provider: | ||
| processors: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test with