π Introduction
Diginsight Components are observable-first .NET libraries that bring built-in observability to common development scenarios like Azure integrations, configuration management, and data access.
Instead of adding observability as an afterthought, these components are designed from the ground up with OpenTelemetry integration, structured logging, and performance metrics built-in.
π― The Problem: Traditional libraries require you to manually add logging, tracing, and monitoring to understand whatβs happening in production.
β¨ The Solution: Diginsight Components provide the same functionality with observability already integrated.
π Quick Value Proposition
- π Zero-Config Observability: Get detailed telemetry without writing boilerplate logging code
- π Built-in Metrics: Automatic performance counters and business metrics (e.g., CosmosDB RU consumption)
- π Distributed Tracing: Full request tracing across components with OpenTelemetry
- π οΈ Drop-in Replacements: Use familiar APIs with enhanced observability features
- βοΈ Cloud-Ready: Optimized for Azure services with built-in monitoring integration
π Table of Contents
π‘ Why Choose Diginsight Components
π Traditional Approach vs. Diginsight Components
Without Diginsight Components:
// Manual logging and monitoring
_logger.LogInformation("Starting CosmosDB query");
var stopwatch = Stopwatch.StartNew();
try
{
var results = await container.GetItemQueryIterator<Product>(query).ReadNextAsync();
_logger.LogInformation("Query completed in {Duration}ms", stopwatch.ElapsedMilliseconds);
// Manual RU consumption tracking...
}
catch (Exception ex)
{
_logger.LogError(ex, "Query failed");
throw;
}With Diginsight Components:
// Automatic observability built-in
var results = await container.GetItemQueryIteratorObservable<Product>(query).ReadNextAsync();
// β
Automatic logging, tracing, RU metrics, error handlingπ― Key Benefits
- β‘ Faster Development: Focus on business logic, not observability plumbing
- π Better Debugging: Rich telemetry helps identify issues quickly
- π Production Insights: Built-in metrics reveal performance bottlenecks
- π‘οΈ Reliability: Consistent error handling and retry patterns
- π Maintainability: Standardized observability across your entire application
ποΈ Architecture Overview
Diginsight Components follow a modular architecture with selective dependencies based on architectural roles:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Application β
β β
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β
β β βοΈ Configuration β β οΏ½ Core β β π Azure β β
β β Components β β Components β β Components β β
β β β β β β β β
β β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β β
β β β.Abstractionsβ β β β.Abstractionsβ β β β.Abstractionsβ β β
β β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β β
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β
β β
β βββββββββββββββββββ β
β β π¨ Presentation β β Choose only what you need β
β β Components β β
β β β β
β β βββββββββββββββ β β
β β β.Abstractionsβ β β
β β βββββββββββββββ β β
β βββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Dependency Architecture
The diagram above shows a simplified view. In reality, the architecture has strategic dependencies:
βοΈ Configuration Components (Orchestrator)
βββ π Azure Components (domain-specific, independent from each other)
βββ π¨ Presentation Components (domain-specific, independent from each other)
βββ π― Core Components (Foundation)
(all components depend on Core)
Key Architectural Principles
- π§© Selective Modularity: Components have strategic dependencies based on their architectural role
- π― Core Foundation:
Diginsight.Componentsprovides foundational utilities that all components can use - βοΈ Configuration Orchestration:
Configurationcomponents can use and configure all other components - π Domain Independence: Domain-specific components (Azure, Presentation) are independent from each other
- π Abstractions Pattern: Every component comes with its
.Abstractionsassembly for clean dependency injection - π Observable by Default: Every component includes built-in telemetry and metrics
βοΈ Configuration Components Orchestration
Diginsight.Components.Configuration provides configurable activation capabilities:
- π Cross-Component Configuration: Can configure and activate features across different component assemblies
- π Centralized Activation: Provides configurable activation capabilities for various components
- π§ Component Orchestration: Manages startup, initialization, and configuration of other components
- ποΈ Feature Toggles: Enables/disables component features through configuration
// based on appsettings-json configuration,
// Configuration Components activate observability for all other components
services.AddObservability(configuration, hostEnvironment, out IOpenTelemetryOptions openTelemetryOptions);Component Assembly Pattern
Each functional area provides two assemblies:
Diginsight.Components.{Area}- Implementation with observable extensionsDiginsight.Components.{Area}.Abstractions- Interfaces and contracts for DI
This allows you to:
- Reference only abstractions in your domain layer
- Reference implementations in your composition root
- Test easily with clean interfaces
- Avoid circular dependencies
π Getting Started
π¦ Installation
Install the components you need via NuGet:
# For enhanced configuration
dotnet add package Diginsight.Components.Configuration
# For Azure services (CosmosDB, Tables, etc.)
dotnet add package Diginsight.Components.Azure
# For core utilities
dotnet add package Diginsight.ComponentsβοΈ Basic Setup
// Program.cs or Startup.cs
builder.Services.AddDiginsightConfiguration()
.AddDiginsightAzure()
.AddOpenTelemetry(); // Automatic observabilityπ― Your First Observable Operation
// Instead of regular CosmosDB client
var results = await container.GetItemQueryIteratorObservable<Product>(
"SELECT * FROM c WHERE c.category = @category"
).ReadNextAsync();
// β
Automatically provides:
// - Distributed tracing spans
// - RU consumption metrics
// - Query performance logging
// - Error tracking and correlationπ¦ Available Components
Components are organized by functionality and include both implementation and abstraction packages for clean dependency injection.
βοΈ Configuration Components
Cross-cutting configuration management with component activation capabilities
Diginsight.Components.Configuration
- Purpose: Cross-component configuration orchestrator that provides enhanced .NET configuration with observability and component activation
- Key Features:
- π Azure Key Vault Integration: Automatic authentication and secret management
- ποΈ Component Activation: Configurable activation of other Diginsight components
- π Startup Diagnostics: Configuration troubleshooting and validation
- π Environment-Specific Config: Support for
.local,.environmentfiles - π Configuration Observability: Full visibility into configuration sources and values
- π§ Cross-Component Settings: Centralized configuration for Azure, Core, and Presentation components
- Use Cases:
- Applications requiring centralized configuration management
- Multi-component applications needing coordinated activation
- Secure configuration with Azure Key Vault integration
- Development environments with local configuration overrides
Diginsight.Components.Configuration.Abstractions
- Purpose: Interfaces and contracts for configuration orchestration
- Key Features: Configuration provider interfaces, component activation contracts, cross-cutting configuration patterns
π― Core Components
Essential functionality with built-in observability
Diginsight.Components
- Purpose: Common utilities with observable patterns
- Key Features:
- π Observable HTTP client configuration
- π Authentication and JWT token handling with telemetry
- π‘οΈ Cryptography support with operation tracking
- βοΈ Microsoft Identity integration
- Use Cases: Any application needing HTTP clients, authentication, or security features
Diginsight.Components.Abstractions
- Purpose: Core interfaces for all components
- Key Features:
IDebugServiceinterface, base contracts, common patterns
π Azure Components
Azure services with built-in observability and advanced metrics
Diginsight.Components.Azure
- Purpose: Observable Azure service integrations
- Key Features:
- π CosmosDB Extensions: Query operations with RU consumption metrics, performance tracking
- ποΈ Azure Table Extensions: Table operations with built-in observability
- βοΈ Other Azure Services: Observable patterns for various Azure APIs
- Use Cases: Applications using Azure data services needing performance insights
Diginsight.Components.Azure.Abstractions
- Purpose: Interfaces for Azure service integrations
- Key Features: Base contracts for Azure observable extensions
π¨ Presentation Components
UI and API layer components (In Development)
Diginsight.Components.Presentation
- Purpose: UI/API specific observability features
- Status: Currently in development
- Planned Features: MVC/API telemetry, request/response tracking, user journey analytics
πΌ Use Cases & Examples
π’ Enterprise Application
// Full stack observability
builder.Services
.AddDiginsightConfiguration() // π Observable configuration
.AddDiginsightAzure() // βοΈ Azure service telemetry
.AddDiginsightPresentation(); // π¨ API/UI observabilityπ Microservice with CosmosDB
// Focus on Azure data services
builder.Services
.AddDiginsightConfiguration()
.AddDiginsightAzure();
// Your service gets automatic observability
public class ProductService
{
public async Task<Product> GetProductAsync(string id)
{
// Automatic: tracing, logging, RU metrics, error handling
return await _container.ReadItemObservableAsync<Product>(id, new PartitionKey(id));
}
}π οΈ Development & Debugging
// Enhanced configuration for local development
builder.Configuration
.AddDiginsightConfiguration() // Loads .local files, enables debug logging
.AddKeyVault(); // Connects to dev Key Vault automaticallyπ References
π Diginsight Documentation
- Diginsight Telemetry - Core observability platform
- Diginsight Smartcache - Hybrid caching strategies
- Diginsight GitHub - Source code and examples
π OpenTelemetry & Observability
- OpenTelemetry .NET - .NET observability standards
- Azure Monitor - Azure observability platform
- Distributed Tracing - Tracing concepts
βοΈ Azure & .NET Technologies
- Azure Cosmos DB - Document database service
- Azure Key Vault - Secrets management
- .NET Configuration - Configuration patterns
- ASP.NET Core - Web framework