Confinity Documentation
  • Latest Version
  • Latest Version
  • Getting Started

    • Introduction
    • Core Concepts
    • Create an Application
    • Glossary
  • Essentials

    • Authentication & SSO
    • Breaking Changes
    • Roslyn Source Analyzers
    • Changelog
    • ConfinityContent
    • ConfinitySelectable
    • Confinity Schedules
    • Data Seeding
    • Development guidelines [WIP]
    • Entity App
    • Entity Form
    • Entity Permissions
    • Frontend Configuration
    • Images
    • Known Issues
    • Localization
    • Migrations
    • Modules [WIP]
    • On-Site Editing
    • Settings
    • Cascade Delete
    • Replication
    • Infrastructure
  • Modules

    • Analytics Module
    • Assets Module
    • Blog Module
    • Cookie Consent Module
    • Forms Module
    • Friendly Captcha (Forms Module )
    • GeoIP Module
    • Htmx
    • Mail Module
    • Mailing Module
    • MediaPlayer Module
    • GoogleMyBusiness Module
    • OpenTelemetry Module
    • Pages Module [WIP]
    • Pattern Library Module
    • SIX Saferpay (worldline) Module
    • Products Module
    • Search Module
    • Wizard Module
  • Guides

    • Create a Custom Entity App Form Element
    • Date and Time
    • Entity Change Listener
    • File Upload / Temp File
    • HTTP security headers
    • conventions [WIP]
    • How to use Confinity with nginx
    • Notifications
    • Nullability
    • Rename Entity
    • Schedules
    • Useful snippets
    • Content Localization
  • Design Guidelines

    • Introduction
    • Page Components
    • Forms Module

OpenTelemetry Module

Confinity supports OpenTelemetry to help you with insights. Add the package Confinity.OpenTelemetry which has useful helpers to make the integration easier.

Allows you to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) to help you analyze your software’s performance and behavior.

More information about OpenTelemetry and how it works can be found at https://opentelemetry.io/ .

Configuration

services.AddOpenTelemetryMetrics((builder) =>
    builder
        .AddConfinityInstrumentation()
        .AddAspNetCoreInstrumentation() // optional
        .AddHttpClientInstrumentation() // optional
        .AddSomeExporter() // Todo: add Exporter
);
services.AddOpenTelemetryTracing((builder) => builder
        .AddConfinityInstrumentation()
        .AddHttpClientInstrumentation() // optional
        .AddAspNetCoreInstrumentation() // optional
        .AddSqlClientInstrumentation() // optional
        .AddSomeExporter() // Todo: add Exporter
);

These packages allow you to get insights about your application with little effort:

  • OpenTelemetry.Instrumentation.AspNetCore
  • OpenTelemetry.Instrumentation.Http
  • OpenTelemetry.Instrumentation.SqlClient
  • OpenTelemetry.Instrumentation.EntityFrameworkCore
  • OpenTelemetry.Instrumentation.Runtime

Example

Add OpenTelemetry to your DI.


services.AddOpenTelemetry()
    .WithMetrics(b =>
    {
        b.AddConfinityInstrumentation(o =>
            {
                o.LogMetrics = true; // outputs metrics in the logs as an alternative to separate metrics collection. 
            })
            // .AddAspNetCoreInstrumentation() // if you have OpenTelemetry.Instrumentation.AspNetCore
            // .AddRuntimeInstrumentation()    // if you have OpenTelemetry.Instrumentation.Runtime
            // .AddHttpClientInstrumentation() // if you have OpenTelemetry.Instrumentation.Http
            // others
            ;
    })
    .WithTracing(b =>
    {
        b.AddConfinityInstrumentation(o =>
            {
                /* ... */
            })
            // .AddConfinityInstrumentation()
            // .AddHttpClientInstrumentation() // if you have OpenTelemetry.Instrumentation.Http
            // .AddAspNetCoreInstrumentation() // if you have OpenTelemetry.Instrumentation.AspNetCore
            // .AddSqlClientInstrumentation()  // if you have OpenTelemetry.Instrumentation.SqlClient
            // others
            ;
    });

Prev
GoogleMyBusiness Module
Next
Pages Module [WIP]