Observability Templates¶
This document provides an overview of observability templates available in the ConnectSoft ecosystem. It is written for DevOps engineers and architects understanding how to configure observability, monitoring, logging, and tracing for services.
ConnectSoft provides templates for generating observability configurations that enable comprehensive monitoring, logging, metrics collection, and distributed tracing.
Note
Observability templates are designed to work with services generated by the Factory. They follow ConnectSoft's observability-driven design principles and integrate with OpenTelemetry and Azure monitoring services.
Purpose¶
Observability templates enable the creation of:
- Distributed tracing - End-to-end request tracing across services
- Metrics collection - Application and infrastructure metrics
- Structured logging - Centralized, structured logging
- Dashboards - Pre-configured monitoring dashboards
- Alerts - Alerting rules and notifications
OpenTelemetry Integration¶
OpenTelemetry Configuration¶
- Template: OpenTelemetry instrumentation template
- Features:
- Automatic instrumentation
- Custom instrumentation
- Exporters configuration
- Resource attributes
- Sampling configuration
- Use Cases: All microservices, distributed systems
Supported Exporters¶
- Azure Monitor - Azure Application Insights
- Jaeger - Distributed tracing backend
- Prometheus - Metrics collection
- OTLP - OpenTelemetry Protocol
- Console - Development and debugging
HTTP request latency (ConnectSoft.Extensions.Telemetry)¶
Service templates ship NuGet ConnectSoft.Extensions.Telemetry on Application and ApplicationModel projects. Together with Microsoft.AspNetCore.Diagnostics.Middleware, hosts record per-request LatencyData and export structured logs plus System.Diagnostics.Metrics histograms (consumable via OpenTelemetry when meters are scraped). MicroserviceRegistrationBase registers AddMicroserviceLatencyTelemetryCollection / UseMicroserviceLatencyTelemetryCollection.
- Configuration: validated section
ConnectSoftLatencyTelemetryinappsettings*.json(strict binding). - Full guide (developer-facing): Latency telemetry — ConnectSoft.Documentation
- Package list: ConnectSoft.Extensions catalog
- Company Libraries Catalog entry: Libraries Catalog (entry 44, ConnectSoft.Extensions.Telemetry)
For an internal briefing, see HTTP request latency (library).
Logging Templates¶
Structured Logging¶
- Template: Structured logging configuration
- Features:
- JSON logging format
- Correlation IDs
- Log levels and filtering
- Log enrichment
- Log aggregation
- Use Cases: All services, centralized logging
Logging Frameworks¶
- Serilog - Structured logging for .NET
- NLog - Flexible logging framework
- Microsoft.Extensions.Logging - .NET logging abstractions
Log Destinations¶
- Azure Log Analytics - Centralized log storage
- Application Insights - Azure monitoring
- Elasticsearch - Search and analytics
- File system - Local file logging (development)
Metrics Templates¶
Application Metrics¶
- Template: Application metrics configuration
- Features:
- Custom metrics
- Business metrics
- Performance metrics
- Health metrics
- Use Cases: Service monitoring, performance tracking
Infrastructure Metrics¶
- Template: Infrastructure metrics configuration
- Features:
- CPU and memory metrics
- Network metrics
- Database metrics
- Message queue metrics
- Use Cases: Infrastructure monitoring, capacity planning
Metrics Exporters¶
- Prometheus - Metrics collection and storage
- Azure Monitor - Azure metrics
- Grafana - Metrics visualization
Tracing Templates¶
Distributed Tracing¶
- Template: Distributed tracing configuration
- Features:
- Span creation and propagation
- Trace context propagation
- Sampling strategies
- Trace export
- Use Cases: Microservices, distributed systems
Trace Backends¶
- Jaeger - Distributed tracing system
- Zipkin - Distributed tracing system
- Azure Application Insights - Azure tracing
- OpenTelemetry Collector - Trace processing
Template Structure¶
An observability template generates this structure:
Observability/
├── opentelemetry/
│ ├── instrumentation configuration
│ └── exporter configuration
├── logging/
│ ├── logging configuration
│ └── log enrichment
├── metrics/
│ ├── metrics definitions
│ └── metrics exporters
├── tracing/
│ ├── tracing configuration
│ └── sampling configuration
└── dashboards/
└── monitoring dashboards
Key Features¶
Correlation and Context¶
- Correlation IDs - Request correlation across services
- Trace context - Distributed trace context propagation
- Baggage - Custom context propagation
- Activity tracking - .NET Activity API integration
Instrumentation¶
- Automatic instrumentation - Framework-level instrumentation
- Custom instrumentation - Application-specific instrumentation
- Library instrumentation - Third-party library instrumentation
- Manual instrumentation - Custom span and metric creation
Sampling¶
- Head-based sampling - Sampling at trace start
- Tail-based sampling - Sampling at trace end
- Rate-based sampling - Percentage-based sampling
- Adaptive sampling - Dynamic sampling based on load
Dashboards and Visualization¶
- Grafana dashboards - Pre-configured Grafana dashboards
- Azure dashboards - Azure Monitor dashboards
- Custom dashboards - Service-specific dashboards
- Alert dashboards - Alert status dashboards
Integration with Services¶
Observability templates integrate with Factory-generated services:
- Auto-instrumentation - Automatic observability setup
- Standard metrics - Pre-configured standard metrics
- Health checks - Health check instrumentation
- Dependency tracking - Automatic dependency tracking
- Performance monitoring - Performance metrics collection
Best Practices¶
Observability Best Practices¶
- Three pillars - Logs, metrics, and traces
- Structured logging - JSON-formatted, structured logs
- Correlation - Request correlation across services
- Sampling - Appropriate sampling strategies
- Alerting - Meaningful alert rules
Performance Considerations¶
- Low overhead - Minimal performance impact
- Async export - Asynchronous telemetry export
- Batching - Batch telemetry export
- Sampling - Reduce telemetry volume
- Filtering - Filter unnecessary telemetry
Health Checks Aggregator template (ConnectSoft.HealthChecksAggregatorTemplate)¶
The Health Checks Aggregator is a Layer 3 service template (not a generic JSON/YAML “observability template” fragment). It provides a dedicated host that:
- Polls downstream services’ health HTTP endpoints and aggregates results
- Serves AspNetCore.HealthChecks.UI for a live dashboard and history (SQL Server or InMemory storage)
- Exposes
/api/health/*for automation plus readiness gate logic for orchestration - Sends webhook alerts (e.g. Slack, Teams) on status transitions
- Ships with the same base-template cross-cutting stack as other web hosts (Serilog, optional OpenTelemetry, metrics, resource monitoring) when those flags are enabled
Docs: Company summary · Templates registry row. Deep reference: repository README.
Related Documents¶
- Templates Overview - Overview of all templates
- Health Checks Aggregator — company summary — centralized health aggregation host
- Microservice Template - ConnectSoft.MicroserviceTemplate
- DevOps Templates - CI/CD templates
- Observability-Driven Design - Observability principles
- Monitoring & Dashboards - Operations monitoring