-
Notifications
You must be signed in to change notification settings - Fork 501
[CONFIGURATION] File configuration - metric model #3474
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 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5cf0181
[CONFIGURATION] File configuration - metric model
marcalff e369094
Merge branch 'main' into merge_config_metric_model
ThomsonTan 80a953b
Merge branch 'main' into merge_config_metric_model
marcalff 86dc419
Refresh code from PR #2518, to fix review comments (clang-tidy)
marcalff ccd0453
Merge branch 'main' into merge_config_metric_model
marcalff 64d52c1
Fixed TODO for enum temporality_preference
marcalff 9530da4
Merge branch 'main' into merge_config_metric_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
30 changes: 30 additions & 0 deletions
30
sdk/include/opentelemetry/sdk/configuration/console_push_metric_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,30 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "opentelemetry/sdk/configuration/headers_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/push_metric_exporter_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/push_metric_exporter_configuration_visitor.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/common.json | ||
| // YAML-NODE: Console | ||
| class ConsolePushMetricExporterConfiguration : public PushMetricExporterConfiguration | ||
| { | ||
| public: | ||
| void Accept(PushMetricExporterConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitConsole(this); | ||
| } | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE | ||
32 changes: 32 additions & 0 deletions
32
sdk/include/opentelemetry/sdk/configuration/metric_producer_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/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
| class MetricProducerConfigurationVisitor; | ||
|
|
||
| // YAML-SCHEMA: schema/meter_provider.json | ||
| // YAML-NODE: MetricProducer | ||
| class MetricProducerConfiguration | ||
| { | ||
| public: | ||
| MetricProducerConfiguration() = default; | ||
| MetricProducerConfiguration(MetricProducerConfiguration &&) = default; | ||
| MetricProducerConfiguration(const MetricProducerConfiguration &) = default; | ||
| MetricProducerConfiguration &operator=(MetricProducerConfiguration &&) = default; | ||
| MetricProducerConfiguration &operator=(const MetricProducerConfiguration &other) = default; | ||
| virtual ~MetricProducerConfiguration() = default; | ||
|
|
||
| virtual void Accept(MetricProducerConfigurationVisitor *visitor) const = 0; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
32 changes: 32 additions & 0 deletions
32
sdk/include/opentelemetry/sdk/configuration/metric_reader_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/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
| class MetricReaderConfigurationVisitor; | ||
|
|
||
| // YAML-SCHEMA: schema/meter_provider.json | ||
| // YAML-NODE: MetricReader | ||
| class MetricReaderConfiguration | ||
| { | ||
| public: | ||
| MetricReaderConfiguration() = default; | ||
| MetricReaderConfiguration(MetricReaderConfiguration &&) = default; | ||
| MetricReaderConfiguration(const MetricReaderConfiguration &) = default; | ||
| MetricReaderConfiguration &operator=(MetricReaderConfiguration &&) = default; | ||
| MetricReaderConfiguration &operator=(const MetricReaderConfiguration &other) = default; | ||
| virtual ~MetricReaderConfiguration() = default; | ||
|
|
||
| virtual void Accept(MetricReaderConfigurationVisitor *visitor) const = 0; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
34 changes: 34 additions & 0 deletions
34
sdk/include/opentelemetry/sdk/configuration/metric_reader_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,34 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| class PeriodicMetricReaderConfiguration; | ||
| class PullMetricReaderConfiguration; | ||
|
|
||
| class MetricReaderConfigurationVisitor | ||
| { | ||
| public: | ||
| MetricReaderConfigurationVisitor() = default; | ||
| MetricReaderConfigurationVisitor(MetricReaderConfigurationVisitor &&) = default; | ||
| MetricReaderConfigurationVisitor(const MetricReaderConfigurationVisitor &) = default; | ||
| MetricReaderConfigurationVisitor &operator=(MetricReaderConfigurationVisitor &&) = default; | ||
| MetricReaderConfigurationVisitor &operator=(const MetricReaderConfigurationVisitor &other) = | ||
| default; | ||
| virtual ~MetricReaderConfigurationVisitor() = default; | ||
|
|
||
| virtual void VisitPeriodic(const PeriodicMetricReaderConfiguration *model) = 0; | ||
| virtual void VisitPull(const PullMetricReaderConfiguration *model) = 0; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
37 changes: 37 additions & 0 deletions
37
sdk/include/opentelemetry/sdk/configuration/otlp_file_push_metric_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,37 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "opentelemetry/sdk/configuration/default_histogram_aggregation.h" | ||
| #include "opentelemetry/sdk/configuration/headers_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/push_metric_exporter_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/push_metric_exporter_configuration_visitor.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/meter_provider.json | ||
| // YAML-NODE: ExperimentalOtlpFileMetricExporter | ||
| class OtlpFilePushMetricExporterConfiguration : public PushMetricExporterConfiguration | ||
| { | ||
| public: | ||
| void Accept(PushMetricExporterConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitOtlpFile(this); | ||
| } | ||
|
|
||
| std::string output_stream; | ||
| std::string temporality_preference; // FIXME: enum | ||
marcalff marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| enum_default_histogram_aggregation default_histogram_aggregation{explicit_bucket_histogram}; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE | ||
46 changes: 46 additions & 0 deletions
46
sdk/include/opentelemetry/sdk/configuration/otlp_grpc_push_metric_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/default_histogram_aggregation.h" | ||
| #include "opentelemetry/sdk/configuration/headers_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/push_metric_exporter_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/push_metric_exporter_configuration_visitor.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/meter_provider.json | ||
| // YAML-NODE: OtlpGrpcMetricExporter | ||
| class OtlpGrpcPushMetricExporterConfiguration : public PushMetricExporterConfiguration | ||
| { | ||
| public: | ||
| void Accept(PushMetricExporterConfigurationVisitor *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; | ||
| std::size_t timeout{0}; | ||
| bool insecure{false}; | ||
| std::string temporality_preference; // FIXME: enum | ||
| enum_default_histogram_aggregation default_histogram_aggregation{explicit_bucket_histogram}; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
47 changes: 47 additions & 0 deletions
47
sdk/include/opentelemetry/sdk/configuration/otlp_http_push_metric_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/default_histogram_aggregation.h" | ||
| #include "opentelemetry/sdk/configuration/headers_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/otlp_http_encoding.h" | ||
| #include "opentelemetry/sdk/configuration/push_metric_exporter_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/push_metric_exporter_configuration_visitor.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/meter_provider.json | ||
| // YAML-NODE: OtlpHttpMetricExporter | ||
| class OtlpHttpPushMetricExporterConfiguration : public PushMetricExporterConfiguration | ||
| { | ||
| public: | ||
| void Accept(PushMetricExporterConfigurationVisitor *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; | ||
| std::size_t timeout{0}; | ||
| enum_otlp_http_encoding encoding{protobuf}; | ||
| std::string temporality_preference; // FIXME: enum | ||
| enum_default_histogram_aggregation default_histogram_aggregation{explicit_bucket_histogram}; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
39 changes: 39 additions & 0 deletions
39
sdk/include/opentelemetry/sdk/configuration/periodic_metric_reader_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,39 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <memory> | ||
| #include <vector> | ||
|
|
||
| #include "opentelemetry/sdk/configuration/metric_producer_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/metric_reader_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/metric_reader_configuration_visitor.h" | ||
| #include "opentelemetry/sdk/configuration/push_metric_exporter_configuration.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/meter_provider.json | ||
| // YAML-NODE: PeriodicMetricReader | ||
| class PeriodicMetricReaderConfiguration : public MetricReaderConfiguration | ||
| { | ||
| public: | ||
| void Accept(MetricReaderConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitPeriodic(this); | ||
| } | ||
|
|
||
| std::size_t interval{0}; | ||
| std::size_t timeout{0}; | ||
| std::unique_ptr<PushMetricExporterConfiguration> exporter; | ||
| std::vector<std::unique_ptr<MetricProducerConfiguration>> producers; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
39 changes: 39 additions & 0 deletions
39
sdk/include/opentelemetry/sdk/configuration/prometheus_pull_metric_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,39 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "opentelemetry/sdk/configuration/headers_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/pull_metric_exporter_configuration.h" | ||
| #include "opentelemetry/sdk/configuration/pull_metric_exporter_configuration_visitor.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
|
|
||
| // YAML-SCHEMA: schema/meter_provider.json | ||
| // YAML-NODE: Prometheus | ||
| class PrometheusPullMetricExporterConfiguration : public PullMetricExporterConfiguration | ||
| { | ||
| public: | ||
| void Accept(PullMetricExporterConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitPrometheus(this); | ||
| } | ||
|
|
||
| std::string host; | ||
| std::size_t port{0}; | ||
| bool without_units{false}; | ||
| bool without_type_suffix{false}; | ||
| bool without_scope_info{false}; | ||
| // FIXME: with_resource_constant_labels; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
31 changes: 31 additions & 0 deletions
31
sdk/include/opentelemetry/sdk/configuration/pull_metric_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,31 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace sdk | ||
| { | ||
| namespace configuration | ||
| { | ||
| class PullMetricExporterConfigurationVisitor; | ||
|
|
||
| class PullMetricExporterConfiguration | ||
| { | ||
| public: | ||
| PullMetricExporterConfiguration() = default; | ||
| PullMetricExporterConfiguration(PullMetricExporterConfiguration &&) = default; | ||
| PullMetricExporterConfiguration(const PullMetricExporterConfiguration &) = default; | ||
| PullMetricExporterConfiguration &operator=(PullMetricExporterConfiguration &&) = default; | ||
| PullMetricExporterConfiguration &operator=(const PullMetricExporterConfiguration &other) = | ||
| default; | ||
| virtual ~PullMetricExporterConfiguration() = default; | ||
|
|
||
| virtual void Accept(PullMetricExporterConfigurationVisitor *visitor) const = 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.