-
Notifications
You must be signed in to change notification settings - Fork 438
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
Add preview feature-flag/macro for metrics #745
Conversation
Codecov Report
@@ Coverage Diff @@
## main #745 +/- ##
==========================================
+ Coverage 94.75% 95.95% +1.20%
==========================================
Files 217 174 -43
Lines 9919 7127 -2792
==========================================
- Hits 9399 6839 -2560
+ Misses 520 288 -232
|
I'm OK with this change in general. But instead of changing 51 files - it could have also been handled in a more elegant fashion by a relatively small 3-4 lines feature flag in CMake, i.e. NOT including any of these files as part of the build. It would have been a single option and a relatively isolated change in I approve this only because I do not know how to handle the exclusion of directory in Bazel in more flexible way, i.e. how to handle build combos in Bazel. Simplest for Bazel would have been to add the entirety of metrics to contents of
to |
@@ -469,3 +470,9 @@ TEST(PrometheusExporterUtils, TranslateToPrometheusMultipleAggregators) | |||
prometheus_client::MetricType::Gauge, 1, vals); | |||
} | |||
OPENTELEMETRY_END_NAMESPACE | |||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you wouldn't have needed it if you excluded the entire folder. It would've been just 2-3 build infra files changed instead of 51 source code files.
@maxgolov Yes it would be definitely easy to ignore entire 'metrics' related folders in CMake build and also probably some way to do through bazel. But our releases are source archives, and idea is to add preview flag explicitly in source to ensure that metrics is not part of build irrespective of whatever build system is used for this released source (not just bazel or cmake). |
Could we maybe additionally ignore folders related to metrics? Otherwise we end up with empty targets for metrics, which might be confusing for users. |
Also, we should think about enabling |
Yes Johannes, I did realize that after raising the PR. As you mentioned, better would be enabling metrics preview for our CI builds. |
Changes
The metrics implementation is not complete ( and may need a complete rewrite ), so it needs to be behind the feature-flag as we are planning for 1.0.0 RC ( 1.0.0 release is only for tracing signal, not metrics and logs).
As per the feature flag policy defined in Versioning.md - This PR just wraps all the metrics code (api, sdk, tests, exporter, example ) under ENABLE_METRICS_PREVIEW hashdef.
The changes look huge as the clang-format does the indentation of preprocessor directives within this wrapper.
CHANGELOG.md
updated for non-trivial changes