Skip to content

feat(otel): db-span enrichment, IMeterFactory metrics, sub-second buckets - #7

Merged
yandersr merged 1 commit into
mainfrom
1.3.0
Jun 23, 2026
Merged

feat(otel): db-span enrichment, IMeterFactory metrics, sub-second buckets#7
yandersr merged 1 commit into
mainfrom
1.3.0

Conversation

@yandersr

Copy link
Copy Markdown
Contributor
  • DatabaseSpanEnrichmentProcessor (auto via AddMediatorInstrumentation) + SqlStatementParser: parses db.statement in-process -> redaction-safe db.operation.name / db.sql.table / db.stored_procedure.name, so each query is a distinct dependency (never the raw statement).
  • metrics created from the DI IMeterFactory (MediatorMetrics singleton) + AddMetrics(); static Meter removed. ActivitySource stays static + named.
  • mediator.request.duration: explicit sub-second InstrumentAdvice bucket boundaries so p95/p99 are meaningful at millisecond scale.
  • stream production metrics emitted on the stream tracing behavior.
  • README fix (RecordMetrics -> EnableMetrics) + DB enrichment; opentelemetry.md + ADR-0005 amendment. Version 1.1.0-rc.2.
  • tests 97: bucket advice end-to-end (InMemory exporter), parser, processor, procedures, wiring.

…kets

- DatabaseSpanEnrichmentProcessor (auto via AddMediatorInstrumentation) + SqlStatementParser:
  parses db.statement in-process -> redaction-safe db.operation.name / db.sql.table /
  db.stored_procedure.name, so each query is a distinct dependency (never the raw statement).
- metrics created from the DI IMeterFactory (MediatorMetrics singleton) + AddMetrics();
  static Meter removed. ActivitySource stays static + named.
- mediator.request.duration: explicit sub-second InstrumentAdvice bucket boundaries so
  p95/p99 are meaningful at millisecond scale.
- stream production metrics emitted on the stream tracing behavior.
- README fix (RecordMetrics -> EnableMetrics) + DB enrichment; opentelemetry.md +
  ADR-0005 amendment. Version 1.1.0-rc.2.
- tests 97: bucket advice end-to-end (InMemory exporter), parser, processor, procedures, wiring.
@github-actions

Copy link
Copy Markdown
Contributor

Summary

Summary
Generated on: 06/23/2026 - 03:19:34
Coverage date: 06/23/2026 - 03:19:12 - 06/23/2026 - 03:19:29
Parser: MultiReport (8x Cobertura)
Assemblies: 6
Classes: 67
Files: 61
Line coverage: 94% (3390 of 3605)
Covered lines: 3390
Uncovered lines: 215
Coverable lines: 3605
Total lines: 8464
Branch coverage: 82.3% (1337 of 1624)
Covered branches: 1337
Total branches: 1624
Method coverage: Feature is only available for sponsors
Tag: 136_27999753916

Coverage

DSoftStudio.Mediator - 98.1%
Name Line Branch
DSoftStudio.Mediator 98.1% 94.1%
DSoftStudio.Mediator.BehaviorHandlerAdapter`2 100% 100%
DSoftStudio.Mediator.HandlerCache`2 100% 100%
DSoftStudio.Mediator.Mediator 100% 91.6%
DSoftStudio.Mediator.MediatorBuilder 100% 100%
DSoftStudio.Mediator.NotificationCachedDispatcher 100% 100%
DSoftStudio.Mediator.NotificationDispatch`1 100%
DSoftStudio.Mediator.NotificationHandlerCache`1 100% 100%
DSoftStudio.Mediator.NotificationObjectDispatch 90.4% 75%
DSoftStudio.Mediator.NotificationPublisherFlag 100% 100%
DSoftStudio.Mediator.ParallelNotificationPublisher 100% 100%
DSoftStudio.Mediator.PipelineChainCache`2 100% 100%
DSoftStudio.Mediator.PipelineChainHandler`2 98% 93%
DSoftStudio.Mediator.RequestDispatch`2 100%
DSoftStudio.Mediator.RequestObjectDispatch 90.9% 50%
DSoftStudio.Mediator.SequentialNotificationPublisher 100% 100%
DSoftStudio.Mediator.ServiceCollectionExtensions 100%
DSoftStudio.Mediator.StreamBehaviorHandlerAdapter`2 100% 100%
DSoftStudio.Mediator.StreamDispatch`2 100%
DSoftStudio.Mediator.StreamHandlerCache`2 100% 100%
DSoftStudio.Mediator.StreamPipelineChainCache`2 100% 100%
DSoftStudio.Mediator.StreamPipelineChainHandler`2 92.8% 75%
DSoftStudio.Mediator.StreamPipelineInvoker 100% 100%
DSoftStudio.Mediator.Abstractions - 100%
Name Line Branch
DSoftStudio.Mediator.Abstractions 100% ****
DSoftStudio.Mediator.Abstractions.MediatorHandlerRegistrationAttribute 100%
DSoftStudio.Mediator.Abstractions.RequestExceptionHandlerState`1 100%
DSoftStudio.Mediator.Abstractions.Unit 100%
DSoftStudio.Mediator.FluentValidation - 100%
Name Line Branch
DSoftStudio.Mediator.FluentValidation 100% 87.5%
DSoftStudio.Mediator.FluentValidation.FluentValidationServiceCollectionExte
nsions
100%
DSoftStudio.Mediator.FluentValidation.MediatorValidationException 100% 83.3%
DSoftStudio.Mediator.FluentValidation.ValidationBehavior`2 100% 90%
DSoftStudio.Mediator.Generators - 92.9%
Name Line Branch
DSoftStudio.Mediator.Generators 92.9% 78.4%
DSoftStudio.Mediator.Generators.BehaviorTypeInfo 100% 100%
DSoftStudio.Mediator.Generators.CqrsSemanticAnalyzer 86.3% 61.5%
DSoftStudio.Mediator.Generators.DependencyInjectionGenerator 96.8% 88.5%
DSoftStudio.Mediator.Generators.DiagnosticDescriptors 100%
DSoftStudio.Mediator.Generators.EquatableArray`1 100% 92.8%
DSoftStudio.Mediator.Generators.HandlerDiscovery 97.1% 84%
DSoftStudio.Mediator.Generators.InterceptorHelpers 84.2% 55.8%
DSoftStudio.Mediator.Generators.MediatorExtensionsGenerator 93.4% 69.3%
DSoftStudio.Mediator.Generators.MediatorPipelineGenerator 92.9% 78.2%
DSoftStudio.Mediator.Generators.MixedRegistrationApiAnalyzer 91.1% 74.5%
DSoftStudio.Mediator.Generators.MockDetectionAnalyzer 100% 100%
DSoftStudio.Mediator.Generators.NotificationGenerator 92.5% 77.7%
DSoftStudio.Mediator.Generators.PublishInterceptorGenerator 90.4% 67.2%
DSoftStudio.Mediator.Generators.ReferencedAssemblyScanner 85.8% 81.6%
DSoftStudio.Mediator.Generators.SelfHandlerDetail 100% 83.3%
DSoftStudio.Mediator.Generators.SelfHandlerParam 100% 83.3%
DSoftStudio.Mediator.Generators.SendInterceptorGenerator 91.6% 75%
DSoftStudio.Mediator.Generators.StreamGenerator 94.9% 81%
DSoftStudio.Mediator.Generators.StreamInterceptorGenerator 90.9% 73.3%
DSoftStudio.Mediator.HybridCache - 100%
Name Line Branch
DSoftStudio.Mediator.HybridCache 100% 100%
DSoftStudio.Mediator.HybridCache.CachingBehavior`2 100% 100%
DSoftStudio.Mediator.HybridCache.HybridCacheServiceCollectionExtensions 100%
DSoftStudio.Mediator.HybridCache.ICachedRequest 100%
DSoftStudio.Mediator.OpenTelemetry - 96.8%
Name Line Branch
DSoftStudio.Mediator.OpenTelemetry 96.8% 90%
DSoftStudio.Mediator.OpenTelemetry.ActivityHelper 100% 100%
DSoftStudio.Mediator.OpenTelemetry.DatabaseSpanEnrichmentProcessor 95% 92.3%
DSoftStudio.Mediator.OpenTelemetry.InstrumentedNotificationPublisher 97.3% 89.1%
DSoftStudio.Mediator.OpenTelemetry.MediatorInstrumentation 100% 50%
DSoftStudio.Mediator.OpenTelemetry.MediatorInstrumentationOptions 100%
DSoftStudio.Mediator.OpenTelemetry.MediatorMetrics 100%
DSoftStudio.Mediator.OpenTelemetry.MediatorMetricsBehavior`2 100% 100%
DSoftStudio.Mediator.OpenTelemetry.MediatorNotificationMetadata`1 100%
DSoftStudio.Mediator.OpenTelemetry.MediatorStreamMetadata`2 100%
DSoftStudio.Mediator.OpenTelemetry.MediatorStreamMetricsBehavior`2 100% 85.7%
DSoftStudio.Mediator.OpenTelemetry.MediatorStreamTracingBehavior`2 100% 83.3%
DSoftStudio.Mediator.OpenTelemetry.MediatorTelemetryMetadata`2 100% 100%
DSoftStudio.Mediator.OpenTelemetry.MediatorTracingBehavior`2 100% 90%
DSoftStudio.Mediator.OpenTelemetry.OpenTelemetryServiceCollectionExtensions 86.8% 77.2%
DSoftStudio.Mediator.OpenTelemetry.SqlStatementParser 95.2% 94.2%
OpenTelemetry.Metrics.MediatorMeterProviderBuilderExtensions 100%
OpenTelemetry.Trace.MediatorTracerProviderBuilderExtensions 100%

@yandersr
yandersr merged commit 1913065 into main Jun 23, 2026
6 checks passed
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.

1 participant