open-telemetry / opentelemetry-dotnet-contrib

This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
https://opentelemetry.io
Apache License 2.0
454 stars 273 forks source link

[repo] Simplify preprocessor directives #1924

Closed joegoldman2 closed 3 months ago

joegoldman2 commented 3 months ago

Changes

Same as https://github.com/open-telemetry/opentelemetry-dotnet/pull/5712. This PR remove versions from preprocessor directives where possible.

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

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 72.17%. Comparing base (71655ce) to head (068fb02). Report is 343 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/graphs/tree.svg?width=650&height=150&src=pr&token=DG2DEROH83&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-dotnet-contrib/pull/1924?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 #1924 +/- ## ========================================== - Coverage 73.91% 72.17% -1.75% ========================================== Files 267 302 +35 Lines 9615 11140 +1525 ========================================== + Hits 7107 8040 +933 - Misses 2508 3100 +592 ``` | [Flag](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [unittests-Exporter.Geneva](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `53.20% <ø> (?)` | | | [unittests-Exporter.InfluxDB](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `95.88% <ø> (?)` | | | [unittests-Exporter.Instana](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `68.22% <ø> (?)` | | | [unittests-Exporter.OneCollector](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `91.51% <ø> (?)` | | | [unittests-Exporter.Stackdriver](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `75.73% <ø> (?)` | | | [unittests-Extensions](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `79.83% <ø> (?)` | | | [unittests-Extensions.AWS](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `83.41% <ø> (?)` | | | [unittests-Extensions.Enrichment](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `100.00% <ø> (?)` | | | [unittests-Instrumentation.AWS](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `80.59% <ø> (?)` | | | [unittests-Instrumentation.AWSLambda](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `87.96% <ø> (?)` | | | [unittests-Instrumentation.AspNet](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `74.85% <ø> (?)` | | | [unittests-Instrumentation.AspNetCore](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `85.27% <ø> (?)` | | | [unittests-Instrumentation.ElasticsearchClient](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `79.87% <ø> (?)` | | | [unittests-Instrumentation.EntityFrameworkCore](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `55.49% <ø> (?)` | | | [unittests-Instrumentation.EventCounters](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `76.36% <ø> (?)` | | | [unittests-Instrumentation.GrpcNetClient](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `79.61% <ø> (?)` | | | [unittests-Instrumentation.Hangfire](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `93.58% <ø> (?)` | | | [unittests-Instrumentation.Http](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `81.08% <ø> (?)` | | | [unittests-Instrumentation.Process](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `100.00% <ø> (?)` | | | [unittests-Instrumentation.Quartz](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `78.94% <ø> (?)` | | | [unittests-Instrumentation.Runtime](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `100.00% <ø> (?)` | | | [unittests-Instrumentation.SqlClient](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `91.89% <ø> (?)` | | | [unittests-Instrumentation.StackExchangeRedis](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `68.02% <0.00%> (?)` | | | [unittests-Instrumentation.Wcf](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `78.47% <ø> (?)` | | | [unittests-PersistentStorage](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `65.44% <ø> (?)` | | | [unittests-Resources.AWS](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `76.72% <ø> (?)` | | | [unittests-Resources.Azure](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `78.35% <ø> (?)` | | | [unittests-Resources.Container](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `72.41% <ø> (?)` | | | [unittests-Resources.Gcp](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `72.54% <ø> (?)` | | | [unittests-Resources.Host](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `51.16% <ø> (?)` | | | [unittests-Resources.Process](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `81.81% <100.00%> (?)` | | | [unittests-Resources.ProcessRuntime](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `82.35% <ø> (?)` | | | [unittests-Sampler.AWS](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `87.97% <100.00%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [...xporter.Geneva/Internal/ConnectionStringBuilder.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?src=pr&el=tree&filepath=src%2FOpenTelemetry.Exporter.Geneva%2FInternal%2FConnectionStringBuilder.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuRXhwb3J0ZXIuR2VuZXZhL0ludGVybmFsL0Nvbm5lY3Rpb25TdHJpbmdCdWlsZGVyLmNz) | `90.69% <ø> (-2.25%)` | :arrow_down: | | [...Geneva/Metrics/Transport/MetricEtwDataTransport.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?src=pr&el=tree&filepath=src%2FOpenTelemetry.Exporter.Geneva%2FMetrics%2FTransport%2FMetricEtwDataTransport.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuRXhwb3J0ZXIuR2VuZXZhL01ldHJpY3MvVHJhbnNwb3J0L01ldHJpY0V0d0RhdGFUcmFuc3BvcnQuY3M=) | `33.33% <ø> (-40.01%)` | :arrow_down: | | [...er.Geneva/MsgPackExporter/MessagePackSerializer.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?src=pr&el=tree&filepath=src%2FOpenTelemetry.Exporter.Geneva%2FMsgPackExporter%2FMessagePackSerializer.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuRXhwb3J0ZXIuR2VuZXZhL01zZ1BhY2tFeHBvcnRlci9NZXNzYWdlUGFja1NlcmlhbGl6ZXIuY3M=) | `90.15% <ø> (-2.09%)` | :arrow_down: | | [...neva/MsgPackExporter/Transport/EtwDataTransport.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?src=pr&el=tree&filepath=src%2FOpenTelemetry.Exporter.Geneva%2FMsgPackExporter%2FTransport%2FEtwDataTransport.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuRXhwb3J0ZXIuR2VuZXZhL01zZ1BhY2tFeHBvcnRlci9UcmFuc3BvcnQvRXR3RGF0YVRyYW5zcG9ydC5jcw==) | `0.00% <ø> (-85.00%)` | :arrow_down: | | [...etry.Exporter.Geneva/TLDExporter/JsonSerializer.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?src=pr&el=tree&filepath=src%2FOpenTelemetry.Exporter.Geneva%2FTLDExporter%2FJsonSerializer.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuRXhwb3J0ZXIuR2VuZXZhL1RMREV4cG9ydGVyL0pzb25TZXJpYWxpemVyLmNz) | `36.40% <ø> (-2.18%)` | :arrow_down: | | [...er.OneCollector/Internal/ConnectionStringParser.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?src=pr&el=tree&filepath=src%2FOpenTelemetry.Exporter.OneCollector%2FInternal%2FConnectionStringParser.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuRXhwb3J0ZXIuT25lQ29sbGVjdG9yL0ludGVybmFsL0Nvbm5lY3Rpb25TdHJpbmdQYXJzZXIuY3M=) | `100.00% <ø> (ø)` | | | [...Exporter.OneCollector/Internal/EventNameManager.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?src=pr&el=tree&filepath=src%2FOpenTelemetry.Exporter.OneCollector%2FInternal%2FEventNameManager.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuRXhwb3J0ZXIuT25lQ29sbGVjdG9yL0ludGVybmFsL0V2ZW50TmFtZU1hbmFnZXIuY3M=) | `97.14% <ø> (ø)` | | | [...ector/Internal/ExtensionFieldInformationManager.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?src=pr&el=tree&filepath=src%2FOpenTelemetry.Exporter.OneCollector%2FInternal%2FExtensionFieldInformationManager.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuRXhwb3J0ZXIuT25lQ29sbGVjdG9yL0ludGVybmFsL0V4dGVuc2lvbkZpZWxkSW5mb3JtYXRpb25NYW5hZ2VyLmNz) | `97.22% <ø> (ø)` | | | [...lector/Internal/OneCollectorExporterEventSource.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?src=pr&el=tree&filepath=src%2FOpenTelemetry.Exporter.OneCollector%2FInternal%2FOneCollectorExporterEventSource.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuRXhwb3J0ZXIuT25lQ29sbGVjdG9yL0ludGVybmFsL09uZUNvbGxlY3RvckV4cG9ydGVyRXZlbnRTb3VyY2UuY3M=) | `42.85% <ø> (ø)` | | | [...rialization/CommonSchemaJsonSerializationHelper.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?src=pr&el=tree&filepath=src%2FOpenTelemetry.Exporter.OneCollector%2FInternal%2FSerialization%2FCommonSchemaJsonSerializationHelper.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuRXhwb3J0ZXIuT25lQ29sbGVjdG9yL0ludGVybmFsL1NlcmlhbGl6YXRpb24vQ29tbW9uU2NoZW1hSnNvblNlcmlhbGl6YXRpb25IZWxwZXIuY3M=) | `100.00% <ø> (ø)` | | | ... and [29 more](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | | ... and [280 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1924/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)