Skip to content

Commit a6ad72d

Browse files
committed
Add file configuration types for Tracer, Meter, and Logger
Implement ExperimentalTracerConfig, ExperimentalTracerConfigurator, ExperimentalTracerMatcherAndConfig and their Meter/Logger equivalents as defined in the declarative configuration spec. - Add 9 new configuration model headers (Config, MatcherAndConfig, Configurator for each signal) - Wire configurator fields into TracerProviderConfiguration, MeterProviderConfiguration, and LoggerProviderConfiguration - Implement YAML parsing for the new configuration types in ConfigurationParser - Add ScopeConfigurator creation with wildcard name matching in SdkBuilder - Add unit tests for parsing the new configurator sections Resolves #3915
1 parent 082620c commit a6ad72d

19 files changed

+969
-10
lines changed

sdk/include/opentelemetry/sdk/configuration/configuration_parser.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
#include "opentelemetry/sdk/configuration/double_attribute_value_configuration.h"
3131
#include "opentelemetry/sdk/configuration/drop_aggregation_configuration.h"
3232
#include "opentelemetry/sdk/configuration/exemplar_filter.h"
33+
#include "opentelemetry/sdk/configuration/experimental_logger_configurator_configuration.h"
34+
#include "opentelemetry/sdk/configuration/experimental_meter_configurator_configuration.h"
35+
#include "opentelemetry/sdk/configuration/experimental_tracer_configurator_configuration.h"
3336
#include "opentelemetry/sdk/configuration/explicit_bucket_histogram_aggregation_configuration.h"
3437
#include "opentelemetry/sdk/configuration/extension_log_record_exporter_configuration.h"
3538
#include "opentelemetry/sdk/configuration/extension_log_record_processor_configuration.h"
@@ -164,6 +167,16 @@ class ConfigurationParser
164167
std::unique_ptr<LoggerProviderConfiguration> ParseLoggerProviderConfiguration(
165168
const std::unique_ptr<DocumentNode> &node) const;
166169

170+
ExperimentalLoggerConfigConfiguration ParseExperimentalLoggerConfigConfiguration(
171+
const std::unique_ptr<DocumentNode> &node) const;
172+
173+
ExperimentalLoggerMatcherAndConfigConfiguration
174+
ParseExperimentalLoggerMatcherAndConfigConfiguration(
175+
const std::unique_ptr<DocumentNode> &node) const;
176+
177+
std::unique_ptr<ExperimentalLoggerConfiguratorConfiguration>
178+
ParseExperimentalLoggerConfiguratorConfiguration(const std::unique_ptr<DocumentNode> &node) const;
179+
167180
DefaultHistogramAggregation ParseDefaultHistogramAggregation(
168181
const std::unique_ptr<DocumentNode> &node,
169182
const std::string &name) const;
@@ -266,6 +279,16 @@ class ConfigurationParser
266279
std::unique_ptr<MeterProviderConfiguration> ParseMeterProviderConfiguration(
267280
const std::unique_ptr<DocumentNode> &node) const;
268281

282+
ExperimentalMeterConfigConfiguration ParseExperimentalMeterConfigConfiguration(
283+
const std::unique_ptr<DocumentNode> &node) const;
284+
285+
ExperimentalMeterMatcherAndConfigConfiguration
286+
ParseExperimentalMeterMatcherAndConfigConfiguration(
287+
const std::unique_ptr<DocumentNode> &node) const;
288+
289+
std::unique_ptr<ExperimentalMeterConfiguratorConfiguration>
290+
ParseExperimentalMeterConfiguratorConfiguration(const std::unique_ptr<DocumentNode> &node) const;
291+
269292
std::unique_ptr<PropagatorConfiguration> ParsePropagatorConfiguration(
270293
const std::unique_ptr<DocumentNode> &node) const;
271294

@@ -336,6 +359,16 @@ class ConfigurationParser
336359
std::unique_ptr<TracerProviderConfiguration> ParseTracerProviderConfiguration(
337360
const std::unique_ptr<DocumentNode> &node) const;
338361

362+
ExperimentalTracerConfigConfiguration ParseExperimentalTracerConfigConfiguration(
363+
const std::unique_ptr<DocumentNode> &node) const;
364+
365+
ExperimentalTracerMatcherAndConfigConfiguration
366+
ParseExperimentalTracerMatcherAndConfigConfiguration(
367+
const std::unique_ptr<DocumentNode> &node) const;
368+
369+
std::unique_ptr<ExperimentalTracerConfiguratorConfiguration>
370+
ParseExperimentalTracerConfiguratorConfiguration(const std::unique_ptr<DocumentNode> &node) const;
371+
339372
std::unique_ptr<StringAttributeValueConfiguration> ParseStringAttributeValueConfiguration(
340373
const std::unique_ptr<DocumentNode> &node) const;
341374

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
#include "opentelemetry/version.h"
7+
8+
OPENTELEMETRY_BEGIN_NAMESPACE
9+
namespace sdk
10+
{
11+
namespace configuration
12+
{
13+
14+
// YAML-SCHEMA: schema/logger_provider.json
15+
// YAML-NODE: ExperimentalLoggerConfig
16+
class ExperimentalLoggerConfigConfiguration
17+
{
18+
public:
19+
bool disabled{false};
20+
};
21+
22+
} // namespace configuration
23+
} // namespace sdk
24+
OPENTELEMETRY_END_NAMESPACE
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
#include <vector>
7+
8+
#include "opentelemetry/sdk/configuration/experimental_logger_config_configuration.h"
9+
#include "opentelemetry/sdk/configuration/experimental_logger_matcher_and_config_configuration.h"
10+
#include "opentelemetry/version.h"
11+
12+
OPENTELEMETRY_BEGIN_NAMESPACE
13+
namespace sdk
14+
{
15+
namespace configuration
16+
{
17+
18+
// YAML-SCHEMA: schema/logger_provider.json
19+
// YAML-NODE: ExperimentalLoggerConfigurator
20+
class ExperimentalLoggerConfiguratorConfiguration
21+
{
22+
public:
23+
ExperimentalLoggerConfigConfiguration default_config;
24+
std::vector<ExperimentalLoggerMatcherAndConfigConfiguration> loggers;
25+
};
26+
27+
} // namespace configuration
28+
} // namespace sdk
29+
OPENTELEMETRY_END_NAMESPACE
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
#include <string>
7+
8+
#include "opentelemetry/sdk/configuration/experimental_logger_config_configuration.h"
9+
#include "opentelemetry/version.h"
10+
11+
OPENTELEMETRY_BEGIN_NAMESPACE
12+
namespace sdk
13+
{
14+
namespace configuration
15+
{
16+
17+
// YAML-SCHEMA: schema/logger_provider.json
18+
// YAML-NODE: ExperimentalLoggerMatcherAndConfig
19+
class ExperimentalLoggerMatcherAndConfigConfiguration
20+
{
21+
public:
22+
std::string name;
23+
ExperimentalLoggerConfigConfiguration config;
24+
};
25+
26+
} // namespace configuration
27+
} // namespace sdk
28+
OPENTELEMETRY_END_NAMESPACE
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
#include "opentelemetry/version.h"
7+
8+
OPENTELEMETRY_BEGIN_NAMESPACE
9+
namespace sdk
10+
{
11+
namespace configuration
12+
{
13+
14+
// YAML-SCHEMA: schema/meter_provider.yaml
15+
// YAML-NODE: ExperimentalMeterConfig
16+
class ExperimentalMeterConfigConfiguration
17+
{
18+
public:
19+
bool disabled{false};
20+
};
21+
22+
} // namespace configuration
23+
} // namespace sdk
24+
OPENTELEMETRY_END_NAMESPACE
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
#include <vector>
7+
8+
#include "opentelemetry/sdk/configuration/experimental_meter_config_configuration.h"
9+
#include "opentelemetry/sdk/configuration/experimental_meter_matcher_and_config_configuration.h"
10+
#include "opentelemetry/version.h"
11+
12+
OPENTELEMETRY_BEGIN_NAMESPACE
13+
namespace sdk
14+
{
15+
namespace configuration
16+
{
17+
18+
// YAML-SCHEMA: schema/meter_provider.yaml
19+
// YAML-NODE: ExperimentalMeterConfigurator
20+
class ExperimentalMeterConfiguratorConfiguration
21+
{
22+
public:
23+
ExperimentalMeterConfigConfiguration default_config;
24+
std::vector<ExperimentalMeterMatcherAndConfigConfiguration> meters;
25+
};
26+
27+
} // namespace configuration
28+
} // namespace sdk
29+
OPENTELEMETRY_END_NAMESPACE
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
#include <string>
7+
8+
#include "opentelemetry/sdk/configuration/experimental_meter_config_configuration.h"
9+
#include "opentelemetry/version.h"
10+
11+
OPENTELEMETRY_BEGIN_NAMESPACE
12+
namespace sdk
13+
{
14+
namespace configuration
15+
{
16+
17+
// YAML-SCHEMA: schema/meter_provider.yaml
18+
// YAML-NODE: ExperimentalMeterMatcherAndConfig
19+
class ExperimentalMeterMatcherAndConfigConfiguration
20+
{
21+
public:
22+
std::string name;
23+
ExperimentalMeterConfigConfiguration config;
24+
};
25+
26+
} // namespace configuration
27+
} // namespace sdk
28+
OPENTELEMETRY_END_NAMESPACE
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
#include "opentelemetry/version.h"
7+
8+
OPENTELEMETRY_BEGIN_NAMESPACE
9+
namespace sdk
10+
{
11+
namespace configuration
12+
{
13+
14+
// YAML-SCHEMA: schema/tracer_provider.json
15+
// YAML-NODE: ExperimentalTracerConfig
16+
class ExperimentalTracerConfigConfiguration
17+
{
18+
public:
19+
bool disabled{false};
20+
};
21+
22+
} // namespace configuration
23+
} // namespace sdk
24+
OPENTELEMETRY_END_NAMESPACE
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
#include <vector>
7+
8+
#include "opentelemetry/sdk/configuration/experimental_tracer_config_configuration.h"
9+
#include "opentelemetry/sdk/configuration/experimental_tracer_matcher_and_config_configuration.h"
10+
#include "opentelemetry/version.h"
11+
12+
OPENTELEMETRY_BEGIN_NAMESPACE
13+
namespace sdk
14+
{
15+
namespace configuration
16+
{
17+
18+
// YAML-SCHEMA: schema/tracer_provider.json
19+
// YAML-NODE: ExperimentalTracerConfigurator
20+
class ExperimentalTracerConfiguratorConfiguration
21+
{
22+
public:
23+
ExperimentalTracerConfigConfiguration default_config;
24+
std::vector<ExperimentalTracerMatcherAndConfigConfiguration> tracers;
25+
};
26+
27+
} // namespace configuration
28+
} // namespace sdk
29+
OPENTELEMETRY_END_NAMESPACE
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#pragma once
5+
6+
#include <string>
7+
8+
#include "opentelemetry/sdk/configuration/experimental_tracer_config_configuration.h"
9+
#include "opentelemetry/version.h"
10+
11+
OPENTELEMETRY_BEGIN_NAMESPACE
12+
namespace sdk
13+
{
14+
namespace configuration
15+
{
16+
17+
// YAML-SCHEMA: schema/tracer_provider.json
18+
// YAML-NODE: ExperimentalTracerMatcherAndConfig
19+
class ExperimentalTracerMatcherAndConfigConfiguration
20+
{
21+
public:
22+
std::string name;
23+
ExperimentalTracerConfigConfiguration config;
24+
};
25+
26+
} // namespace configuration
27+
} // namespace sdk
28+
OPENTELEMETRY_END_NAMESPACE

0 commit comments

Comments
 (0)