open-telemetry / opentelemetry-cpp

The OpenTelemetry C++ Client
https://opentelemetry.io/
Apache License 2.0
811 stars 391 forks source link

[Code health] include-what-you-use cleanup, part 2 #2704

Open marcalff opened 1 week ago

marcalff commented 1 week ago

Contributes to #2054

Changes

Changed the include-what-you-use build to:

Performed general cleanup to resolve issues reported by include-what-you-use:

For the most part, applying the code suggestions from include-what-you-use was sufficient.

In some cases, in particular for:

namespace nostd = opentelemetry::nostd;

nostd::xxx foo;

the namespace directive causes iwyu to want a header to declare the nostd namespace itself.

Because there are many available headers, iwyu does not suggest the best choice.

Resolved by removing the namespace alias, and use fully qualified names instead:

opentelemetry::nostd::xxx foo;

This is the second pass at cleanup, follow up work is still required.

For significant contributions please make sure you have completed the following items:

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.67%. Comparing base (497eaf4) to head (aea170b). Report is 94 commits behind head on main.

:exclamation: Current head aea170b differs from pull request most recent head e813e20

Please upload reports for the commit e813e20 to get more accurate results.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704/graphs/tree.svg?width=650&height=150&src=pr&token=FJESTYQ2AD&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ```diff @@ Coverage Diff @@ ## main #2704 +/- ## ========================================== + Coverage 87.12% 87.67% +0.55% ========================================== Files 200 190 -10 Lines 6109 5853 -256 ========================================== - Hits 5322 5131 -191 + Misses 787 722 -65 ``` | [Files](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [exporters/ostream/src/span\_exporter.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704?src=pr&el=tree&filepath=exporters%2Fostream%2Fsrc%2Fspan_exporter.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-ZXhwb3J0ZXJzL29zdHJlYW0vc3JjL3NwYW5fZXhwb3J0ZXIuY2M=) | `87.50% <ø> (-0.61%)` | :arrow_down: | | [sdk/src/logs/logger.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704?src=pr&el=tree&filepath=sdk%2Fsrc%2Flogs%2Flogger.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy9sb2dzL2xvZ2dlci5jYw==) | `78.95% <ø> (ø)` | | | [sdk/src/logs/logger\_provider.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704?src=pr&el=tree&filepath=sdk%2Fsrc%2Flogs%2Flogger_provider.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy9sb2dzL2xvZ2dlcl9wcm92aWRlci5jYw==) | `90.91% <ø> (ø)` | | | [sdk/src/logs/readable\_log\_record.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704?src=pr&el=tree&filepath=sdk%2Fsrc%2Flogs%2Freadable_log_record.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy9sb2dzL3JlYWRhYmxlX2xvZ19yZWNvcmQuY2M=) | `58.34% <ø> (ø)` | | | [sdk/src/metrics/meter.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704?src=pr&el=tree&filepath=sdk%2Fsrc%2Fmetrics%2Fmeter.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy9tZXRyaWNzL21ldGVyLmNj) | `62.14% <ø> (+0.69%)` | :arrow_up: | | [sdk/src/metrics/meter\_provider.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704?src=pr&el=tree&filepath=sdk%2Fsrc%2Fmetrics%2Fmeter_provider.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy9tZXRyaWNzL21ldGVyX3Byb3ZpZGVyLmNj) | `87.18% <ø> (+0.34%)` | :arrow_up: | | [sdk/src/metrics/state/observable\_registry.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704?src=pr&el=tree&filepath=sdk%2Fsrc%2Fmetrics%2Fstate%2Fobservable_registry.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy9tZXRyaWNzL3N0YXRlL29ic2VydmFibGVfcmVnaXN0cnkuY2M=) | `83.73% <ø> (+0.39%)` | :arrow_up: | | [sdk/src/trace/tracer.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704?src=pr&el=tree&filepath=sdk%2Fsrc%2Ftrace%2Ftracer.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy90cmFjZS90cmFjZXIuY2M=) | `82.46% <ø> (ø)` | | | [sdk/src/trace/tracer\_provider.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704?src=pr&el=tree&filepath=sdk%2Fsrc%2Ftrace%2Ftracer_provider.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy90cmFjZS90cmFjZXJfcHJvdmlkZXIuY2M=) | `89.14% <ø> (ø)` | | ... and [106 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/2704/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)