-
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 2 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
33 changes: 33 additions & 0 deletions
33
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,33 @@ | ||
| // 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: | ||
| ConsolePushMetricExporterConfiguration() = default; | ||
| ~ConsolePushMetricExporterConfiguration() override = default; | ||
|
|
||
| void Accept(PushMetricExporterConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitConsole(this); | ||
| } | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE | ||
30 changes: 30 additions & 0 deletions
30
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,30 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <memory> | ||
|
|
||
| #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; | ||
| virtual ~MetricProducerConfiguration() = default; | ||
|
|
||
| virtual void Accept(MetricProducerConfigurationVisitor *visitor) const = 0; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
30 changes: 30 additions & 0 deletions
30
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,30 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <memory> | ||
dbarker marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| #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; | ||
| virtual ~MetricReaderConfiguration() = default; | ||
|
|
||
| virtual void Accept(MetricReaderConfigurationVisitor *visitor) const = 0; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE | ||
29 changes: 29 additions & 0 deletions
29
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,29 @@ | ||
| // 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; | ||
| virtual ~MetricReaderConfigurationVisitor() = default; | ||
|
|
||
| virtual void VisitPeriodic(const PeriodicMetricReaderConfiguration *model) = 0; | ||
| virtual void VisitPull(const PullMetricReaderConfiguration *model) = 0; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
40 changes: 40 additions & 0 deletions
40
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,40 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "opentelemetry/sdk/configuration/exporter_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: | ||
| OtlpFilePushMetricExporterConfiguration() = default; | ||
| ~OtlpFilePushMetricExporterConfiguration() override = default; | ||
|
|
||
| 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 | ||
49 changes: 49 additions & 0 deletions
49
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,49 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <memory> | ||
| #include <string> | ||
|
|
||
| #include "opentelemetry/sdk/configuration/exporter_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: | ||
| OtlpGrpcPushMetricExporterConfiguration() = default; | ||
| ~OtlpGrpcPushMetricExporterConfiguration() override = default; | ||
dbarker marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 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; | ||
| 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 | ||
50 changes: 50 additions & 0 deletions
50
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,50 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <memory> | ||
| #include <string> | ||
|
|
||
| #include "opentelemetry/sdk/configuration/exporter_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: | ||
| OtlpHttpPushMetricExporterConfiguration() = default; | ||
| ~OtlpHttpPushMetricExporterConfiguration() override = default; | ||
dbarker marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 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; | ||
| 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 | ||
42 changes: 42 additions & 0 deletions
42
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,42 @@ | ||
| // 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: | ||
| PeriodicMetricReaderConfiguration() = default; | ||
| ~PeriodicMetricReaderConfiguration() override = default; | ||
|
|
||
| void Accept(MetricReaderConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitPeriodic(this); | ||
| } | ||
|
|
||
| size_t interval{0}; | ||
| size_t timeout{0}; | ||
| std::unique_ptr<PushMetricExporterConfiguration> exporter; | ||
| std::vector<std::unique_ptr<MetricProducerConfiguration>> producers; | ||
| }; | ||
|
|
||
| } // namespace configuration | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE |
42 changes: 42 additions & 0 deletions
42
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,42 @@ | ||
| // 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: | ||
| PrometheusPullMetricExporterConfiguration() = default; | ||
| ~PrometheusPullMetricExporterConfiguration() override = default; | ||
|
|
||
| void Accept(PullMetricExporterConfigurationVisitor *visitor) const override | ||
| { | ||
| visitor->VisitPrometheus(this); | ||
| } | ||
|
|
||
| std::string host; | ||
| 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 |
26 changes: 26 additions & 0 deletions
26
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,26 @@ | ||
| // 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; | ||
| 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.