Skip to content

CRARCH0026 Use Cratis Fundamentals metrics

  • Category: Architecture
  • Default severity: Warning
  • Diagnostic ID: CRARCH0026

Metrics should use Cratis Fundamentals abstractions instead of raw instrument creation.

Avoid direct Meter.{0} usage

Use IMeter<T>, IMeterScope<T>, and generated metric methods instead of creating meter instruments directly. Use the typed meter or scope for the reported instrument creation; helper methods may be source generated, but generation is optional. The C# metrics setup explains package references and dependency-injection registration.