Dibk.Ftpb.Common.AltinnApps 0.7.1-preview-2

This is a prerelease version of Dibk.Ftpb.Common.AltinnApps.
dotnet add package Dibk.Ftpb.Common.AltinnApps --version 0.7.1-preview-2                
NuGet\Install-Package Dibk.Ftpb.Common.AltinnApps -Version 0.7.1-preview-2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dibk.Ftpb.Common.AltinnApps" Version="0.7.1-preview-2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Dibk.Ftpb.Common.AltinnApps --version 0.7.1-preview-2                
#r "nuget: Dibk.Ftpb.Common.AltinnApps, 0.7.1-preview-2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Dibk.Ftpb.Common.AltinnApps as a Cake Addin
#addin nuget:?package=Dibk.Ftpb.Common.AltinnApps&version=0.7.1-preview-2&prerelease

// Install Dibk.Ftpb.Common.AltinnApps as a Cake Tool
#tool nuget:?package=Dibk.Ftpb.Common.AltinnApps&version=0.7.1-preview-2&prerelease                

Dibk.Ftpb.Common.AltinnApps

Verktøyklasser for å konfigurere og sette opp Altinn 3 applikasjoner i DIBK sitt FtPB-økosystem.

Eksport av OTEL data til Elasticsearch

Registrering av service for eksport av OTEL-metrics til Elasticsearch gjøres vha extensionmetoden AddOtelElasticExporters. Det er viktig å påse at servicen blir registert etter at settings er henta fra KeyVault.

<details>

<summary>Eksempel på registrering av service</summary>

// ###########################################################################
// # Unless you are sure what you are doing do not change the following code #
// ###########################################################################

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

ConfigureServices(builder.Services, builder.Configuration);

builder.WebHost.ConfigureAppWebHost(args);

if (!builder.Environment.IsDevelopment())
{
    builder.AddAzureKeyVaultAsConfigProvider(); // KeyVault lastes her
}

builder.Services.AddOtelElasticExporters(builder.Configuration); // Registrere her

WebApplication app = builder.Build();

Configure();

app.Run();

</details>

Appsettings

Settings som må være på plass for at ekspostering av OpenTelemetry-data til Elasticsearch skal fungere

appsettings.json må inneholde følgende:

{
  "AppSettings": {    
    "UseOpenTelemetry": true
  },
  "OTEL_RESOURCE_ATTRIBUTES": "deployment.environment=Local",
  "OTEL_METRICS_EXPORTER": "otlp",
  "OTEL_LOGS_EXPORTER": "otlp",
  "OpenTelemetry": {
    "ElasticExporter": {
      "Endpoint": "https://ein-eller-ana-identifikator.apm.uksouth.azure.elastic-cloud.com:443"
    }
  }
}  

Miljøspesifikke appsettings.{miljø}.json inneholder endringer fra standarden. Dette er typisk som følger:

{
  "OTEL_RESOURCE_ATTRIBUTES": "deployment.environment=Test", // Miljø
  "OpenTelemetry": {
    "ElasticExporter": {
      "Endpoint": "https://ein-heilt-ana-identifiketor.apm.uksouth.azure.elastic-cloud.com:443" // endepunkt
    }
  }
}

Key vault

Key vault (eller secrets.json ved lokal utvikling) må inneholde authorization settings Key: OpenTelemetry--ElasticExporter--Headers Value: Authorization=Bearer heMMEligHET2000

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.7.1-preview-2 45 12/3/2024

0.0.1 - Initial version.