-
Notifications
You must be signed in to change notification settings - Fork 9
Add native AoT annotations #358
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,9 @@ public static class MeterProviderBuilderExtensions | |||||
| /// <param name="builder">A <see cref="MeterProviderBuilder"/></param> | ||||||
| /// <param name="configure">A callback for customizing default Grafana OpenTelemetry settings</param> | ||||||
| /// <returns>A modified <see cref="MeterProviderBuilder"/> </returns> | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Grafana OpenTelemetry distribution for .NET does not support native AoT.")] | ||||||
| #endif | ||||||
| public static MeterProviderBuilder UseGrafana(this MeterProviderBuilder builder, Action<GrafanaOpenTelemetrySettings> configure = default) | ||||||
| { | ||||||
| GrafanaOpenTelemetrySettings settings = new GrafanaOpenTelemetrySettings(); | ||||||
|
|
@@ -66,6 +69,9 @@ internal static MeterProviderBuilder AddInstrumentations(this MeterProviderBuild | |||||
| return builder; | ||||||
| } | ||||||
|
|
||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This functionality uses reflection to discover and instantiate resource detectors, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This resource detector uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This resource detector uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This resource detector uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This resource detector uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This resource detector uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This resource detector uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,6 +9,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This resource detector uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,6 +9,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This resource detector uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,6 +9,9 @@ | |||||
|
|
||||||
| namespace Grafana.OpenTelemetry | ||||||
| { | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This resource detector uses reflection for type discovery, which is not compatible with native AoT compilation.")] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,9 @@ public static class TracerProviderBuilderExtensions | |||||
| /// <param name="builder">A <see cref="TracerProviderBuilder"/></param> | ||||||
| /// <param name="configure">A callback for customizing default Grafana OpenTelemetry settings</param> | ||||||
| /// <returns>A modified <see cref="TracerProviderBuilder"/> </returns> | ||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Grafana OpenTelemetry distribution for .NET does not support native AoT.")] | ||||||
| #endif | ||||||
| public static TracerProviderBuilder UseGrafana(this TracerProviderBuilder builder, Action<GrafanaOpenTelemetrySettings> configure = default) | ||||||
| { | ||||||
| GrafanaOpenTelemetrySettings settings = new GrafanaOpenTelemetrySettings(); | ||||||
|
|
@@ -66,6 +69,9 @@ internal static TracerProviderBuilder AddInstrumentations(this TracerProviderBui | |||||
| return builder; | ||||||
| } | ||||||
|
|
||||||
| #if NET8_0_OR_GREATER | ||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | ||||||
|
||||||
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types might be removed")] | |
| [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This functionality uses reflection to discover and instantiate resource detectors, which is not compatible with native AoT compilation.")] |
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.
The error message "Types might be removed" is vague and doesn't provide actionable information to developers. Consider using a more descriptive message that explains why this code is incompatible with native AoT.
For example:
"This instrumentation uses reflection for type discovery, which is not compatible with native AoT compilation."This would provide clearer context about the limitation.