-
Notifications
You must be signed in to change notification settings - Fork 500
[CONFIGURATION] File configuration - metric aggregation model #3502
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
9 commits
Select commit
Hold shift + click to select a range
cc4c739
[CONFIGURATION] File configuration - meter aggregation model
marcalff 61b34fd
Merge branch 'main' into merge_config_aggregation_model
marcalff 8b490df
Refresh code from PR #2518, cleanup
marcalff 59b6678
Merge cleanup
marcalff c12c797
Code review comments, enum naming
marcalff 70be6a1
Refresh code from PR #2518, to fix review comments (enum)
marcalff c8e2cd3
Refresh code from PR #2518, to fix review comments.
marcalff a8228cf
Merge branch 'main' into merge_config_aggregation_model
marcalff 31b827f
Merge branch 'main' into merge_config_aggregation_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
32 changes: 32 additions & 0 deletions
32
sdk/include/opentelemetry/sdk/configuration/aggregation_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 AggregationConfigurationVisitor; | ||
|
||
// YAML-SCHEMA: schema/meter_provider.json | ||
// YAML-NODE: aggregation | ||
class AggregationConfiguration | ||
{ | ||
public: | ||
AggregationConfiguration() = default; | ||
AggregationConfiguration(AggregationConfiguration &&) = default; | ||
AggregationConfiguration(const AggregationConfiguration &) = default; | ||
AggregationConfiguration &operator=(AggregationConfiguration &&) = default; | ||
AggregationConfiguration &operator=(const AggregationConfiguration &other) = default; | ||
virtual ~AggregationConfiguration() = default; | ||
|
||
virtual void Accept(AggregationConfigurationVisitor *visitor) const = 0; | ||
}; | ||
|
||
} // namespace configuration | ||
} // namespace sdk | ||
OPENTELEMETRY_END_NAMESPACE |
44 changes: 44 additions & 0 deletions
44
sdk/include/opentelemetry/sdk/configuration/aggregation_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,44 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#include "opentelemetry/version.h" | ||
|
||
OPENTELEMETRY_BEGIN_NAMESPACE | ||
namespace sdk | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
class Base2ExponentialBucketHistogramAggregationConfiguration; | ||
class DefaultAggregationConfiguration; | ||
class DropAggregationConfiguration; | ||
class ExplicitBucketHistogramAggregationConfiguration; | ||
class LastValueAggregationConfiguration; | ||
class SumAggregationConfiguration; | ||
|
||
class AggregationConfigurationVisitor | ||
{ | ||
public: | ||
AggregationConfigurationVisitor() = default; | ||
AggregationConfigurationVisitor(AggregationConfigurationVisitor &&) = default; | ||
AggregationConfigurationVisitor(const AggregationConfigurationVisitor &) = default; | ||
AggregationConfigurationVisitor &operator=(AggregationConfigurationVisitor &&) = default; | ||
AggregationConfigurationVisitor &operator=(const AggregationConfigurationVisitor &other) = | ||
default; | ||
virtual ~AggregationConfigurationVisitor() = default; | ||
|
||
virtual void VisitBase2ExponentialBucketHistogram( | ||
const Base2ExponentialBucketHistogramAggregationConfiguration *model) = 0; | ||
virtual void VisitDefault(const DefaultAggregationConfiguration *model) = 0; | ||
virtual void VisitDrop(const DropAggregationConfiguration *model) = 0; | ||
virtual void VisitExplicitBucketHistogram( | ||
const ExplicitBucketHistogramAggregationConfiguration *model) = 0; | ||
virtual void VisitLastValue(const LastValueAggregationConfiguration *model) = 0; | ||
virtual void VisitSum(const SumAggregationConfiguration *model) = 0; | ||
}; | ||
|
||
} // namespace configuration | ||
} // namespace sdk | ||
OPENTELEMETRY_END_NAMESPACE |
33 changes: 33 additions & 0 deletions
33
...elemetry/sdk/configuration/base2_exponential_bucket_histogram_aggregation_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/aggregation_configuration.h" | ||
#include "opentelemetry/sdk/configuration/aggregation_configuration_visitor.h" | ||
#include "opentelemetry/version.h" | ||
|
||
OPENTELEMETRY_BEGIN_NAMESPACE | ||
namespace sdk | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
// YAML-SCHEMA: schema/meter_provider.json | ||
// YAML-NODE: base2_exponential_bucket_histogram | ||
class Base2ExponentialBucketHistogramAggregationConfiguration : public AggregationConfiguration | ||
{ | ||
public: | ||
void Accept(AggregationConfigurationVisitor *visitor) const override | ||
{ | ||
visitor->VisitBase2ExponentialBucketHistogram(this); | ||
} | ||
|
||
std::size_t max_scale{0}; | ||
std::size_t max_size{0}; | ||
bool record_min_max{false}; | ||
}; | ||
|
||
} // namespace configuration | ||
} // namespace sdk | ||
OPENTELEMETRY_END_NAMESPACE |
29 changes: 29 additions & 0 deletions
29
sdk/include/opentelemetry/sdk/configuration/default_aggregation_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,29 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#include "opentelemetry/sdk/configuration/aggregation_configuration.h" | ||
#include "opentelemetry/sdk/configuration/aggregation_configuration_visitor.h" | ||
#include "opentelemetry/version.h" | ||
|
||
OPENTELEMETRY_BEGIN_NAMESPACE | ||
namespace sdk | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
// YAML-SCHEMA: schema/meter_provider.json | ||
// YAML-NODE: default | ||
class DefaultAggregationConfiguration : public AggregationConfiguration | ||
{ | ||
public: | ||
void Accept(AggregationConfigurationVisitor *visitor) const override | ||
{ | ||
visitor->VisitDefault(this); | ||
} | ||
}; | ||
|
||
} // namespace configuration | ||
} // namespace sdk | ||
OPENTELEMETRY_END_NAMESPACE |
24 changes: 24 additions & 0 deletions
24
sdk/include/opentelemetry/sdk/configuration/default_histogram_aggregation.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,24 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#include <cstdint> | ||
|
||
#include "opentelemetry/version.h" | ||
|
||
OPENTELEMETRY_BEGIN_NAMESPACE | ||
namespace sdk | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
enum enum_default_histogram_aggregation : std::uint8_t | ||
{ | ||
explicit_bucket_histogram, | ||
base2_exponential_bucket_histogram | ||
}; | ||
|
||
} // namespace configuration | ||
} // namespace sdk | ||
OPENTELEMETRY_END_NAMESPACE |
26 changes: 26 additions & 0 deletions
26
sdk/include/opentelemetry/sdk/configuration/drop_aggregation_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/sdk/configuration/aggregation_configuration.h" | ||
#include "opentelemetry/sdk/configuration/aggregation_configuration_visitor.h" | ||
#include "opentelemetry/version.h" | ||
|
||
OPENTELEMETRY_BEGIN_NAMESPACE | ||
namespace sdk | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
// YAML-SCHEMA: schema/meter_provider.json | ||
// YAML-NODE: drop | ||
class DropAggregationConfiguration : public AggregationConfiguration | ||
{ | ||
public: | ||
void Accept(AggregationConfigurationVisitor *visitor) const override { visitor->VisitDrop(this); } | ||
}; | ||
|
||
} // namespace configuration | ||
} // namespace sdk | ||
OPENTELEMETRY_END_NAMESPACE |
34 changes: 34 additions & 0 deletions
34
...ude/opentelemetry/sdk/configuration/explicit_bucket_histogram_aggregation_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,34 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#include <vector> | ||
|
||
#include "opentelemetry/sdk/configuration/aggregation_configuration.h" | ||
#include "opentelemetry/sdk/configuration/aggregation_configuration_visitor.h" | ||
#include "opentelemetry/version.h" | ||
|
||
OPENTELEMETRY_BEGIN_NAMESPACE | ||
namespace sdk | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
// YAML-SCHEMA: schema/meter_provider.json | ||
// YAML-NODE: explicit_bucket_histogram | ||
class ExplicitBucketHistogramAggregationConfiguration : public AggregationConfiguration | ||
{ | ||
public: | ||
void Accept(AggregationConfigurationVisitor *visitor) const override | ||
{ | ||
visitor->VisitExplicitBucketHistogram(this); | ||
} | ||
|
||
std::vector<double> boundaries; | ||
bool record_min_max{false}; | ||
}; | ||
|
||
} // namespace configuration | ||
} // namespace sdk | ||
OPENTELEMETRY_END_NAMESPACE |
30 changes: 30 additions & 0 deletions
30
sdk/include/opentelemetry/sdk/configuration/instrument_type.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 <cstdint> | ||
|
||
#include "opentelemetry/version.h" | ||
|
||
OPENTELEMETRY_BEGIN_NAMESPACE | ||
namespace sdk | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
// YAML-SCHEMA: schema/meter_provider.json | ||
// YAML-NODE: InstrumentType | ||
enum class InstrumentType : std::uint8_t | ||
{ | ||
counter, | ||
histogram, | ||
observable_counter, | ||
observable_gauge, | ||
observable_up_down_counter, | ||
up_down_counter | ||
}; | ||
|
||
} // namespace configuration | ||
} // namespace sdk | ||
OPENTELEMETRY_END_NAMESPACE |
29 changes: 29 additions & 0 deletions
29
sdk/include/opentelemetry/sdk/configuration/last_value_aggregation_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,29 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#include "opentelemetry/sdk/configuration/aggregation_configuration.h" | ||
#include "opentelemetry/sdk/configuration/aggregation_configuration_visitor.h" | ||
#include "opentelemetry/version.h" | ||
|
||
OPENTELEMETRY_BEGIN_NAMESPACE | ||
namespace sdk | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
// YAML-SCHEMA: schema/meter_provider.json | ||
// YAML-NODE: last_value | ||
class LastValueAggregationConfiguration : public AggregationConfiguration | ||
{ | ||
public: | ||
void Accept(AggregationConfigurationVisitor *visitor) const override | ||
{ | ||
visitor->VisitLastValue(this); | ||
} | ||
}; | ||
|
||
} // namespace configuration | ||
} // namespace sdk | ||
OPENTELEMETRY_END_NAMESPACE |
32 changes: 32 additions & 0 deletions
32
sdk/include/opentelemetry/sdk/configuration/meter_provider_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 <memory> | ||
#include <vector> | ||
|
||
#include "opentelemetry/sdk/configuration/metric_reader_configuration.h" | ||
#include "opentelemetry/sdk/configuration/view_configuration.h" | ||
#include "opentelemetry/version.h" | ||
|
||
OPENTELEMETRY_BEGIN_NAMESPACE | ||
namespace sdk | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
// YAML-SCHEMA: schema/meter_provider.json | ||
// YAML-NODE: MeterProvider | ||
class MeterProviderConfiguration | ||
{ | ||
public: | ||
std::vector<std::unique_ptr<MetricReaderConfiguration>> readers; | ||
std::vector<std::unique_ptr<ViewConfiguration>> views; | ||
// FIXME: exemplar_filter | ||
// FIXME: meter_configurator | ||
}; | ||
|
||
} // namespace configuration | ||
} // namespace sdk | ||
OPENTELEMETRY_END_NAMESPACE |
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
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
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
26 changes: 26 additions & 0 deletions
26
sdk/include/opentelemetry/sdk/configuration/sum_aggregation_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/sdk/configuration/aggregation_configuration.h" | ||
#include "opentelemetry/sdk/configuration/aggregation_configuration_visitor.h" | ||
#include "opentelemetry/version.h" | ||
|
||
OPENTELEMETRY_BEGIN_NAMESPACE | ||
namespace sdk | ||
{ | ||
namespace configuration | ||
{ | ||
|
||
// YAML-SCHEMA: schema/meter_provider.json | ||
// YAML-NODE: sum | ||
class SumAggregationConfiguration : public AggregationConfiguration | ||
{ | ||
public: | ||
void Accept(AggregationConfigurationVisitor *visitor) const override { visitor->VisitSum(this); } | ||
}; | ||
|
||
} // namespace configuration | ||
} // namespace sdk | ||
OPENTELEMETRY_END_NAMESPACE |
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
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.