-
Notifications
You must be signed in to change notification settings - Fork 501
[CONFIGURATION] File configuration - trace model #3467
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
854dbf0
[CONFIGURATION] File configuration - trace model
marcalff 8e9663d
Refresh code from PR #2518, to fix code review comments.
marcalff c420322
Merge branch 'main' into merge_config_trace_model
dbarker 131047d
Merge branch 'main' into merge_config_trace_model
marcalff 5a0b22d
Merge branch 'main' into merge_config_trace_model
marcalff 318cf7c
Merge branch 'main' into merge_config_trace_model
marcalff f1148b6
Merge branch 'main' into merge_config_trace_model
lalitb e9b1295
Merge branch 'main' into merge_config_trace_model
marcalff 195e425
Refresh code from PR #2518, to fix review comments (clang-tidy)
marcalff e75a6ac
Merge branch 'main' into merge_config_trace_model
marcalff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
sdk/include/opentelemetry/sdk/configuration/batch_span_processor_configuration.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <memory> | ||
|
|
||
| #include "opentelemetry/sdk/configuration/span_exporter_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/span_processor_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/span_processor_configuration_visitor.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/tracer_provider.json | ||
| // YAML-NODE: BatchSpanProcessor | ||
| class BatchSpanProcessorConfiguration : public SpanProcessorConfiguration | ||
| { | ||
| public: | ||
| BatchSpanProcessorConfiguration() = default; | ||
| ~BatchSpanProcessorConfiguration() override = default; | ||
|
|
||
| void Accept(SpanProcessorConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitBatch(this); | ||
| } | ||
|
|
||
| size_t schedule_delay{0}; | ||
| size_t export_timeout{0}; | ||
| size_t max_queue_size{0}; | ||
| size_t max_export_batch_size{0}; | ||
| std::unique_ptr<SpanExporterConfiguration> exporter; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE | ||
71 changes: 71 additions & 0 deletions
71
sdk/include/opentelemetry/sdk/configuration/configuration.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <memory> | ||
| #include <string> | ||
marcalff marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| #include "opentelemetry/sdk/configuration/attribute_limits_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/document.h" | ||
| #include "opentelemetry/sdk/configuration/logger_provider_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/meter_provider_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/propagator_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/resource_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/tracer_provider_configuration.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| /* | ||
| * General notes about configuration classes. | ||
| * | ||
| * Each Yaml node that exists in the yaml schema, | ||
| * as defined by https://github.com/open-telemetry/opentelemetry-configuration | ||
| * is represented by a C++ class. | ||
| * Special comments are used to relate the C++ class to | ||
| * the Yaml node it represents. | ||
| * | ||
| * YAML-SCHEMA: points to the relevant file within the | ||
| * opentelemetry-configuration repository | ||
| * YAML-NODE: points to the relevant node within the file. | ||
| * | ||
| * For example, | ||
| * C++ class opentelemetry::sdk::configuration::Configuration | ||
| * corresponds to | ||
| * Yaml node OpenTelemetryConfiguration, | ||
| * in file | ||
| * https://github.com/open-telemetry/opentelemetry-configuration/blob/main/schema/opentelemetry_configuration.json | ||
| */ | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/opentelemetry_configuration.json | ||
| // YAML-NODE: OpenTelemetryConfiguration | ||
| class Configuration | ||
| { | ||
| public: | ||
| Configuration(std::unique_ptr<Document> doc) : doc_(std::move(doc)) {} | ||
| ~Configuration() = default; | ||
|
|
||
| std::string file_format; | ||
| bool disabled{false}; | ||
| std::string log_level; | ||
|
|
||
| std::unique_ptr<AttributeLimitsConfiguration> attribute_limits; | ||
| std::unique_ptr<LoggerProviderConfiguration> logger_provider; | ||
| std::unique_ptr<MeterProviderConfiguration> meter_provider; | ||
| std::unique_ptr<PropagatorConfiguration> propagator; | ||
| std::unique_ptr<TracerProviderConfiguration> tracer_provider; | ||
| std::unique_ptr<ResourceConfiguration> resource; | ||
| // Ignored: instrumentation | ||
marcalff marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| private: | ||
| std::unique_ptr<Document> doc_; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE | ||
32 changes: 32 additions & 0 deletions
32
sdk/include/opentelemetry/sdk/configuration/console_span_exporter_configuration.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "opentelemetry/sdk/configuration/span_exporter_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/span_exporter_configuration_visitor.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/common.json | ||
| // YAML-NODE: Console | ||
| class ConsoleSpanExporterConfiguration : public SpanExporterConfiguration | ||
| { | ||
| public: | ||
| ConsoleSpanExporterConfiguration() = default; | ||
| ~ConsoleSpanExporterConfiguration() override = default; | ||
|
|
||
| void Accept(SpanExporterConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitConsole(this); | ||
| } | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
36 changes: 36 additions & 0 deletions
36
sdk/include/opentelemetry/sdk/configuration/otlp_file_span_exporter_configuration.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "opentelemetry/sdk/configuration/span_exporter_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/span_exporter_configuration_visitor.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/common.json | ||
| // YAML-NODE: ExperimentalOtlpFileExporter | ||
| class OtlpFileSpanExporterConfiguration : public SpanExporterConfiguration | ||
| { | ||
| public: | ||
| OtlpFileSpanExporterConfiguration() = default; | ||
| ~OtlpFileSpanExporterConfiguration() override = default; | ||
|
|
||
| void Accept(SpanExporterConfigurationVisitor *visitor) const override | ||
marcalff marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| visitor->VisitOtlpFile(this); | ||
| } | ||
|
|
||
| std::string output_stream; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE | ||
46 changes: 46 additions & 0 deletions
46
sdk/include/opentelemetry/sdk/configuration/otlp_grpc_span_exporter_configuration.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <memory> | ||
| #include <string> | ||
|
|
||
| #include "opentelemetry/sdk/configuration/headers_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/span_exporter_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/span_exporter_configuration_visitor.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/common.json | ||
| // YAML-NODE: OtlpGrpcExporter | ||
| class OtlpGrpcSpanExporterConfiguration : public SpanExporterConfiguration | ||
| { | ||
| public: | ||
| OtlpGrpcSpanExporterConfiguration() = default; | ||
| ~OtlpGrpcSpanExporterConfiguration() override = default; | ||
|
|
||
| void Accept(SpanExporterConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitOtlpGrpc(this); | ||
| } | ||
|
|
||
| std::string endpoint; | ||
| std::string certificate_file; | ||
| std::string client_key_file; | ||
| std::string client_certificate_file; | ||
| std::unique_ptr<HeadersConfiguration> headers; | ||
| std::string headers_list; | ||
| std::string compression; | ||
| size_t timeout{0}; | ||
| bool insecure{false}; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
47 changes: 47 additions & 0 deletions
47
sdk/include/opentelemetry/sdk/configuration/otlp_http_span_exporter_configuration.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <memory> | ||
| #include <string> | ||
|
|
||
| #include "opentelemetry/sdk/configuration/headers_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/otlp_http_encoding.h" | ||
| #include "opentelemetry/sdk/configuration/span_exporter_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/span_exporter_configuration_visitor.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/common.json | ||
| // YAML-NODE: OtlpHttpExporter | ||
| class OtlpHttpSpanExporterConfiguration : public SpanExporterConfiguration | ||
| { | ||
| public: | ||
| OtlpHttpSpanExporterConfiguration() = default; | ||
| ~OtlpHttpSpanExporterConfiguration() override = default; | ||
|
|
||
| void Accept(SpanExporterConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitOtlpHttp(this); | ||
| } | ||
|
|
||
| std::string endpoint; | ||
| std::string certificate_file; | ||
| std::string client_key_file; | ||
| std::string client_certificate_file; | ||
| std::unique_ptr<HeadersConfiguration> headers; | ||
| std::string headers_list; | ||
| std::string compression; | ||
| size_t timeout{0}; | ||
| enum_otlp_http_encoding encoding{protobuf}; | ||
marcalff marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE | ||
36 changes: 36 additions & 0 deletions
36
sdk/include/opentelemetry/sdk/configuration/simple_span_processor_configuration.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <memory> | ||
|
|
||
| #include "opentelemetry/sdk/configuration/span_processor_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/span_processor_configuration_visitor.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/tracer_provider.json | ||
| // YAML-NODE: SimpleSpanProcessor | ||
| class SimpleSpanProcessorConfiguration : public SpanProcessorConfiguration | ||
| { | ||
| public: | ||
| SimpleSpanProcessorConfiguration() = default; | ||
| ~SimpleSpanProcessorConfiguration() override = default; | ||
|
|
||
| void Accept(SpanProcessorConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitSimple(this); | ||
| } | ||
|
|
||
| std::unique_ptr<SpanExporterConfiguration> exporter; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
28 changes: 28 additions & 0 deletions
28
sdk/include/opentelemetry/sdk/configuration/span_exporter_configuration.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
| class SpanExporterConfigurationVisitor; | ||
|
|
||
| // YAML-SCHEMA: schema/tracer_provider.json | ||
| // YAML-NODE: SpanExporter | ||
| class SpanExporterConfiguration | ||
| { | ||
| public: | ||
| SpanExporterConfiguration() = default; | ||
| virtual ~SpanExporterConfiguration() = default; | ||
|
|
||
| virtual void Accept(SpanExporterConfigurationVisitor *visitor) const = 0; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
37 changes: 37 additions & 0 deletions
37
sdk/include/opentelemetry/sdk/configuration/span_exporter_configuration_visitor.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| class OtlpHttpSpanExporterConfiguration; | ||
| class OtlpGrpcSpanExporterConfiguration; | ||
| class OtlpFileSpanExporterConfiguration; | ||
| class ConsoleSpanExporterConfiguration; | ||
| class ZipkinSpanExporterConfiguration; | ||
| class ExtensionSpanExporterConfiguration; | ||
|
|
||
| class SpanExporterConfigurationVisitor | ||
| { | ||
| public: | ||
| SpanExporterConfigurationVisitor() = default; | ||
| virtual ~SpanExporterConfigurationVisitor() = default; | ||
|
|
||
| virtual void VisitOtlpHttp(const OtlpHttpSpanExporterConfiguration *model) = 0; | ||
| virtual void VisitOtlpGrpc(const OtlpGrpcSpanExporterConfiguration *model) = 0; | ||
| virtual void VisitOtlpFile(const OtlpFileSpanExporterConfiguration *model) = 0; | ||
| virtual void VisitConsole(const ConsoleSpanExporterConfiguration *model) = 0; | ||
| virtual void VisitZipkin(const ZipkinSpanExporterConfiguration *model) = 0; | ||
| virtual void VisitExtension(const ExtensionSpanExporterConfiguration *model) = 0; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.