-
Notifications
You must be signed in to change notification settings - Fork 136
Add OTEL export support to GoFeatureFlag integration #966
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
aaronpowell
left a comment
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.
@copilot for the test, assert that it has the OtlpExporterAnnotation annotation and there are environment variables specified here https://github.com/dotnet/aspire/blob/c97743e5f463312ebd2dde2ac454686cc4901a39/src/Aspire.Hosting/OtlpConfigurationExtensions.cs#L62-L110 that can be asserted against.
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Updated the test to assert |
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.
Pull Request Overview
This PR adds OpenTelemetry (OTEL) export support to the GoFeatureFlag integration by calling .WithOtlpExporter() on the resource builder. This enables telemetry export from GoFeatureFlag containers to the Aspire dashboard, addressing the broken OTEL export mentioned in issue #444.
Key changes:
- Added
.WithOtlpExporter()call to the GoFeatureFlag resource builder to enable OTEL support - Added test to verify OtlpExporterAnnotation and EnvironmentCallbackAnnotation are present
- Removed duplicate test with incorrect naming (AddSurrealServerContainerWithLogLevel)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/CommunityToolkit.Aspire.Hosting.GoFeatureFlag/GoFeatureFlagBuilderExtensions.cs | Added .WithOtlpExporter() call to enable OpenTelemetry export support |
| tests/CommunityToolkit.Aspire.Hosting.GoFeatureFlag.Tests/AddGoFeatureFlagTests.cs | Added test to verify OTEL annotations are present; removed duplicate test with incorrect naming; added required imports |
Comments suppressed due to low confidence (1)
tests/CommunityToolkit.Aspire.Hosting.GoFeatureFlag.Tests/AddGoFeatureFlagTests.cs:101
- The test method name 'AddSurrealServerContainerWithLogLevelThrowsOnUnsupportedLogLevel' references 'SurrealServer' but is testing GoFeatureFlag functionality. It should be renamed to 'AddGoFeatureFlagWithLogLevelThrowsOnUnsupportedLogLevel' to accurately reflect what it tests.
public void AddSurrealServerContainerWithLogLevelThrowsOnUnsupportedLogLevel(LogLevel logLevel)
tests/CommunityToolkit.Aspire.Hosting.GoFeatureFlag.Tests/AddGoFeatureFlagTests.cs
Outdated
Show resolved
Hide resolved
…ls of aspire Just verifying that we have the annotation should do enough
|
@Odonno took a while but looks like this will finally be working! |
Minimum allowed line rate is |
| [InlineData(LogLevel.Information, "INFO")] | ||
| [InlineData(LogLevel.Warning, "WARN")] | ||
| [InlineData(LogLevel.Error, "ERROR")] | ||
| public async Task AddSurrealServerContainerWithLogLevel(LogLevel logLevel, string? expected) |
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.
Why deleted?
| [InlineData(LogLevel.Trace)] | ||
| [InlineData(LogLevel.Critical)] | ||
| [InlineData(LogLevel.None)] | ||
| public void AddSurrealServerContainerWithLogLevelThrowsOnUnsupportedLogLevel(LogLevel logLevel) |
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.
| public void AddSurrealServerContainerWithLogLevelThrowsOnUnsupportedLogLevel(LogLevel logLevel) | |
| public void AddGoFeatureFlagWithLogLevelThrowsOnUnsupportedLogLevel(LogLevel logLevel) |

Add OTEL Support to GoFeatureFlag Integration
This PR adds OpenTelemetry (OTEL) export support to the GoFeatureFlag integration to fix issue #444.
Changes Made:
.WithOtlpExporter()call to the GoFeatureFlag resource builderTechnical Details:
.WithOtlpExporter()toAddGoFeatureFlag()method inGoFeatureFlagBuilderExtensions.cs.WithOtlpExporter()method from Aspire.Hosting SDK automatically configures these variablesOtlpExporterAnnotationandEnvironmentCallbackAnnotationare presentWhat This Fixes:
Test Results:
All 7 unit tests pass successfully
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.