Skip to content

v1.0.34 - #91

Merged
yilmaztayfun merged 3 commits into
release-v1.0from
master
Aug 10, 2026
Merged

v1.0.34#91
yilmaztayfun merged 3 commits into
release-v1.0from
master

Conversation

@yilmaztayfun

@yilmaztayfun yilmaztayfun commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Introduce configurable tracing detail levels with business-focused default and align infrastructure diagnostics, HTTP client instrumentation, and aspects with the global tracing profile.

Enhancements:

  • Add global AetherTracingDetailLevel and runtime configuration to control business vs verbose tracing profiles.
  • Default tracing options to the Business profile and wire configuration into Aether telemetry setup.
  • Filter pipeline-detail spans in Business profile while preserving context for child operations.
  • Conditionally enable EF Core and infrastructure diagnostic spans based on the active tracing profile.
  • Refine HTTP client tracing to filter Dapr diagnostic requests in Business profile and enrich Dapr invoke spans with RPC metadata.

Documentation:

  • Document tracing detail levels, their defaults, and how they affect aspects and instrumentation in telemetry and aspects guides.

Tests:

  • Add tests covering tracing detail level behavior, business span filtering, and alignment of aspects/infrastructure diagnostics with the global profile.

@yilmaztayfun yilmaztayfun self-assigned this Aug 10, 2026
@yilmaztayfun
yilmaztayfun requested review from a team August 10, 2026 10:27
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 25504974-b4e8-418c-9e44-3748ecf928fb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces a global tracing detail level (Business vs Verbose) that controls which spans are produced and exported, wires it into ASP.NET Core telemetry options, filters out pipeline-detail spans in Business mode, suppresses infrastructure diagnostic spans unless Verbose, and adds tests/docs for the behavior.

Sequence diagram for telemetry initialization and diagnostic span filtering

sequenceDiagram
    participant AppConfiguration
    participant AddAetherTelemetry
    participant AetherTracingRuntime
    participant TracerProviderBuilder as TracerProvider
    participant BusinessSpanFilterProcessor as BusinessFilter
    participant InfrastructureActivitySource as InfraSource
    participant DistributedLockService as LockService

    AppConfiguration->>AddAetherTelemetry: AddAetherTelemetry(services, configuration)
    AddAetherTelemetry->>AetherTracingRuntime: Configure(opts.Tracing.DetailLevel)

    alt DetailLevel == Business
        AddAetherTelemetry->>TracerProvider: AddProcessor(BusinessSpanFilterProcessor)
    else DetailLevel == Verbose
        AddAetherTelemetry-->>TracerProvider: AddEntityFrameworkCoreInstrumentation()
    end

    LockService->>InfraSource: StartDiagnosticActivity("DistributedLock.Release", ActivityKind.Client, Activity.Current.Context)
    InfraSource->>AetherTracingRuntime: IsVerbose
    alt IsVerbose == true
        InfraSource-->>LockService: Activity instance
    else IsVerbose == false
        InfraSource-->>LockService: null (no diagnostic span)
    end

    LockService-->>BusinessFilter: OnEnd(Activity) when span completes
    BusinessFilter->>BusinessFilter: activity.DisplayName.StartsWith("[")
    alt Business profile and pipeline detail
        BusinessFilter->>BusinessFilter: activity.ActivityTraceFlags &= ~ActivityTraceFlags.Recorded
    else Keep business span
        BusinessFilter-->>LockService: span exported normally
    end
Loading

File-Level Changes

Change Details Files
Introduce global tracing detail level and runtime switch controlling diagnostic vs business spans.
  • Add AetherTracingDetailLevel enum (Business, Verbose) and AetherTracingRuntime static runtime with thread-safe Configure/IsVerbose/DetailLevel.
  • Set default detail level to Business and validate configured values via ArgumentOutOfRangeException.
  • Expose runtime flag for use by static instrumentation and aspects.
framework/src/BBT.Aether.Core/BBT/Aether/Telemetry/AetherTracingProfile.cs
Wire tracing detail level into ASP.NET Core telemetry configuration and OpenTelemetry pipeline.
  • Extend AetherTracingOptions with DetailLevel property defaulting to Business.
  • Configure AetherTracingRuntime.DetailLevel from options in AddAetherTelemetry.
  • Gate Entity Framework Core instrumentation on AetherTracingRuntime.IsVerbose.
  • Add BusinessSpanFilterProcessor that clears Recorded flag for spans whose DisplayName starts with '[' and register it when not verbose.
  • Refine HTTP client instrumentation to skip excluded URLs plus, in Business mode, Dapr diagnostic calls, and enrich Dapr invoke activities with rpc-related tags.
framework/src/BBT.Aether.AspNetCore/Microsoft/Extensions/DependencyInjection/AetherTelemetryServiceCollectionExtensions.cs
framework/src/BBT.Aether.AspNetCore/BBT/Aether/AspNetCore/Telemetry/TelemetryOptions.cs
framework/src/BBT.Aether.AspNetCore/BBT/Aether/AspNetCore/Telemetry/BusinessSpanFilterProcessor.cs
Make infrastructure diagnostic activities follow the global tracing profile instead of always emitting spans.
  • Add InfrastructureActivitySource.StartDiagnosticActivity helper that only starts spans when AetherTracingRuntime.IsVerbose.
  • Replace direct InfrastructureActivitySource.Source.StartActivity calls in Dapr/Redis distributed lock and cache services with StartDiagnosticActivity.
  • Ensure diagnostic spans for distributed cache/lock are suppressed in Business mode and enabled in Verbose mode.
framework/src/BBT.Aether.Infrastructure/BBT/Aether/Telemetry/InfrastructureActivitySource.cs
framework/src/BBT.Aether.Infrastructure/BBT/Aether/DistributedLock/Dapr/DaprDistributedLockService.cs
framework/src/BBT.Aether.Infrastructure/BBT/Aether/DistributedLock/Dapr/DaprDistributedLockHandle.cs
framework/src/BBT.Aether.Infrastructure/BBT/Aether/DistributedLock/Redis/RedisDistributedLockHandle.cs
framework/src/BBT.Aether.Infrastructure/BBT/Aether/DistributedLock/Redis/RedisDistributedLockService.cs
framework/src/BBT.Aether.Infrastructure/BBT/Aether/DistributedCache/Dapr/DaprDistributedCacheService.cs
framework/src/BBT.Aether.Infrastructure/BBT/Aether/DistributedCache/Redis/RedisDistributedCacheService.cs
Document and test the new tracing profiles, span filtering, and business-span behavior.
  • Update aspects README to explain that [Trace] represents business spans emitted in both profiles and that DetailLevel controls diagnostic instrumentation.
  • Update telemetry README to document Tracing.DetailLevel semantics and advise static instrumentation to use AetherTracingRuntime.IsVerbose.
  • Add TraceDetailLevelTests to verify runtime configuration, [Trace] behavior in Business/Verbose, and infrastructure diagnostics honoring the profile.
  • Add BusinessSpanFilterTests to validate default DetailLevel, bracket-prefixed span filtering in Business profile, and retention in Verbose profile.
framework/docs/aspects/README.md
framework/docs/telemetry/README.md
framework/test/BBT.Aether.Infrastructure.Tests/BBT/Aether/Tracing/TraceDetailLevelTests.cs
framework/test/BBT.Aether.Postgres.Tests/BusinessSpanFilterTests.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@yilmaztayfun
yilmaztayfun merged commit 4026db8 into release-v1.0 Aug 10, 2026
3 of 6 checks passed
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 41 complexity · 0 duplication

Metric Results
Complexity 41
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@yilmaztayfun yilmaztayfun changed the title v1.0.31 v1.0.34 Aug 10, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The global AetherTracingRuntime.DetailLevel is mutated in multiple tests, which can cause flaky results when xUnit runs tests in parallel; consider disabling parallelization for these test classes/assembly or isolating the runtime configuration behind a test-only lock or helper.
  • The Dapr-specific HTTP filtering and enrichment logic in ShouldTraceHttpRequest/IsDaprDiagnosticRequest/EnrichHttpClientActivity uses many hard-coded path segments and rules; consider centralising these constants or extracting a dedicated helper to make future Dapr API changes easier to maintain and reason about.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The global AetherTracingRuntime.DetailLevel is mutated in multiple tests, which can cause flaky results when xUnit runs tests in parallel; consider disabling parallelization for these test classes/assembly or isolating the runtime configuration behind a test-only lock or helper.
- The Dapr-specific HTTP filtering and enrichment logic in ShouldTraceHttpRequest/IsDaprDiagnosticRequest/EnrichHttpClientActivity uses many hard-coded path segments and rules; consider centralising these constants or extracting a dedicated helper to make future Dapr API changes easier to maintain and reason about.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants