Skip to content

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

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