Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3539af7
chore: add grafana, otel-collector, prometheus and tempo to docker co…
tnotheis Aug 21, 2026
4dfe184
feat: push metrics to otel collector instead of exposing prometheus m…
tnotheis Aug 21, 2026
e0cecec
feat: remove eventhandler metrics endpoint from helm chart
tnotheis Aug 21, 2026
eae2ed5
feat: send traces
tnotheis Aug 21, 2026
0ea4202
chore: cleanup
tnotheis Aug 21, 2026
3103564
chore: add loki to docker-compose
tnotheis Aug 21, 2026
7e9d377
chore: add loki to grafana datasources
tnotheis Aug 21, 2026
bee438c
feat: export logs to otel endpoint
tnotheis Aug 21, 2026
fcd2b18
feat: transfer state via rabbitmq
tnotheis Aug 23, 2026
10a25a4
refactor: improve database name in traces
tnotheis Aug 23, 2026
c35cb7d
feat: set DeviceId, IdentityAddress and Username on activity
tnotheis Aug 23, 2026
687daf1
refactor: improve trace handling in EventBusRabbitMq
tnotheis Aug 26, 2026
5e11709
feat: add middleware that sets user context data on the baggage
tnotheis Aug 26, 2026
410b56c
Merge branch 'main' into switch-to-opentelementry-for-metrics-and-sen…
tnotheis Aug 26, 2026
995cedc
feat: replace log statements with trace events
tnotheis Aug 26, 2026
286c964
refactor: apply naming conventions for events and tags
tnotheis Aug 26, 2026
f31ea2a
refactor: cleanup
tnotheis Aug 26, 2026
1cfecf2
feat: add HttpClientInstrumentation for tracing
tnotheis Aug 26, 2026
276fb93
feat: add tracing for pubsub and service bus
tnotheis Aug 26, 2026
64c97db
refactor: cleanup
tnotheis Aug 26, 2026
ca1f83f
feat: make otel endpoint configurable
tnotheis Aug 26, 2026
8a718d0
chore: cleanup
tnotheis Aug 26, 2026
efd63b2
chore: change database service name in otel from postgres to database
tnotheis Aug 26, 2026
ef0150b
fix: use correct location of logging config
tnotheis Aug 26, 2026
1cc90dc
chore: remove unused config value
tnotheis Aug 26, 2026
f1f8393
fix: correct logging config location for admin api in appsettings.json
tnotheis Aug 27, 2026
0577efb
chore: remove "preserveStaticLogger" because it messes up opentelemet…
tnotheis Aug 27, 2026
4ecb703
chore: set default value for OpenTelemetryCollector config property
tnotheis Aug 27, 2026
c96366a
feat: use Activity trace id when sending trace id as http response
tnotheis Aug 28, 2026
3aa62f7
fix: remove check for existence of blob in S3BlobStorage and replace …
tnotheis Aug 28, 2026
d5f16c8
feat: add opentelemetry in remaining applications
tnotheis Aug 28, 2026
7d357af
chore: convert log message to trace event
tnotheis Aug 28, 2026
da7cdd8
fix: always return channel, even in case of exception
tnotheis Aug 28, 2026
4e4c669
feat: add activity for Handle method
tnotheis Aug 28, 2026
bd37afd
fix: add missing .csproj files to databasemigrator dockerfile
tnotheis Aug 28, 2026
3fbd091
Merge branch 'main' into switch-to-opentelementry-for-metrics-and-sen…
tnotheis Aug 31, 2026
5899bbf
fix: copy BuildingBlocks.Module into DatabaseMigrator image
tnotheis Aug 31, 2026
bece181
fix: update exchange declaration logic in EventBusRabbitMq
tnotheis Aug 31, 2026
6c938d3
chore: log rabbitmq connection shutdown as warning instead of error
tnotheis Sep 1, 2026
ca90fee
feat: replace housekeeper logs with traces and metrics
tnotheis Sep 2, 2026
3c9dcaa
ci: switch to local builds instead of using cloud builder
tnotheis Sep 2, 2026
a21cc36
Merge branch 'main' into switch-to-opentelementry-for-metrics-and-sen…
mergify[bot] Sep 3, 2026
33e36ac
Merge branch 'main' into switch-to-opentelementry-for-metrics-and-sen…
mergify[bot] Sep 3, 2026
17f9ea7
Merge branch 'main' into switch-to-opentelementry-for-metrics-and-sen…
mergify[bot] Sep 3, 2026
388d979
refactor: some improvements
tnotheis Sep 4, 2026
eabc568
feat: don't enrich logs with service, because we have the resource se…
tnotheis Sep 4, 2026
13edd65
refactor: more cleanup
tnotheis Sep 4, 2026
cb91d2f
refactor: use ApplicationBuilder instead of HostBuilder
tnotheis Sep 4, 2026
d1e6fa1
chore: delete otel console exporter
tnotheis Sep 4, 2026
61f154c
fix: avoid error 409 in trace when azure storage account container al…
tnotheis Sep 4, 2026
62651d7
chore: minor improvements
tnotheis Sep 4, 2026
2187a17
chore: add traceid as tag to root span
tnotheis Sep 4, 2026
e2719ef
chore: update grafana to 13.2.1
tnotheis Sep 4, 2026
2ef14e1
chore: add max_duration configuration to query_frontend metrics
tnotheis Sep 4, 2026
1ebef9c
ci: turn on caching for dotnet in github actions
tnotheis Sep 7, 2026
f50b9fd
ci: remove unnecessary installs in docker build pipeline
tnotheis Sep 7, 2026
4daaccb
Merge branch 'main' into switch-to-opentelementry-for-metrics-and-sen…
mergify[bot] Sep 7, 2026
9bdf8b1
ci: switch back to cloud builder
tnotheis Sep 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 10.0.x
cache: true
cache-dependency-path: "**/packages.lock.json"

- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 10.0.x
cache: true
cache-dependency-path: "**/packages.lock.json"

- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 10.0.x
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Cache NuGet packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
Expand Down Expand Up @@ -76,6 +78,8 @@ jobs:
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 10.0.x
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Cache NuGet packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
Expand Down Expand Up @@ -129,22 +133,11 @@ jobs:
username: ${{ secrets.DHI_DOCKERHUB_USERNAME }}
password: ${{ secrets.DHI_DOCKERHUB_TOKEN }}

- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24.19.0
cache: "npm"
cache-dependency-path: "**/package-lock.json"

- name: Setup Docker
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
with:
driver: docker-container

- name: Setup NuGet
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 10.0.x

- name: Cache Image
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
Expand Down Expand Up @@ -208,6 +201,8 @@ jobs:
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 10.0.x
cache: true
cache-dependency-path: "**/packages.lock.json"

- name: Cache NuGet packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
Expand Down Expand Up @@ -360,6 +355,8 @@ jobs:
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 10.0.x
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Install nuget-licenses tool
run: dotnet tool install --global nuget-license
- name: Show Allowed Licenses
Expand Down
45 changes: 27 additions & 18 deletions .run/docker-compose (with Postgres).run.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="docker-compose (with Postgres)" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<deployment type="docker-compose.yml">
<settings>
<option name="envFilePath" value="" />
<option name="services">
<list>
<option value="seq" />
<option value="rabbitmq" />
<option value="postgres" />
<option value="azure-storage-emulator" />
</list>
</option>
<option name="sourceFilePath" value="docker-compose/docker-compose.yml" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="false" />
<method v="2" />
</configuration>
<configuration default="false" name="docker-compose (with Postgres)" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<deployment type="docker-compose.yml">
<settings>
<option name="envFilePath" value="" />
<option name="envFilePaths">
<list>
<option value="" />
</list>
</option>
<option name="services">
<list>
<option value="seq" />
<option value="rabbitmq" />
<option value="postgres" />
<option value="azure-storage-emulator" />
<option value="grafana" />
<option value="prometheus" />
<option value="tempo" />
<option value="otel-collector" />
</list>
</option>
<option name="sourceFilePath" value="docker-compose/docker-compose.yml" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="false" />
<method v="2" />
</configuration>
</component>
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@
"Microsoft.Extensions.Identity.Core": "[10.0.10, 10.0.10]",
"Microsoft.Extensions.Logging": "[10.0.10, 10.0.10]",
"Npgsql.EntityFrameworkCore.PostgreSQL": "[10.0.3, 10.0.3]",
"OpenTelemetry.Api": "[1.17.0, )",
"Polly": "[8.7.0, 8.7.0]",
"RabbitMQ.Client": "[7.2.1, 7.2.1]",
"Serilog": "[4.4.0, 4.4.0]"
Expand Down Expand Up @@ -888,6 +889,12 @@
"Npgsql": "10.0.3"
}
},
"OpenTelemetry.Api": {
"type": "CentralTransitive",
"requested": "[1.17.0, )",
"resolved": "1.17.0",
"contentHash": "mSBxzomZgHIJu9CyVNqyDu/n2JHEtqVgfcCD1Br0cV5iLYogjZOMqhlVLt99PEp+0KGBNUR3GXgeOdN2GR3F9g=="
},
"Polly": {
"type": "CentralTransitive",
"requested": "[8.7.0, 8.7.0]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@
"Microsoft.Extensions.Identity.Core": "[10.0.10, 10.0.10]",
"Microsoft.Extensions.Logging": "[10.0.10, 10.0.10]",
"Npgsql.EntityFrameworkCore.PostgreSQL": "[10.0.3, 10.0.3]",
"OpenTelemetry.Api": "[1.17.0, )",
"Polly": "[8.7.0, 8.7.0]",
"RabbitMQ.Client": "[7.2.1, 7.2.1]",
"Serilog": "[4.4.0, 4.4.0]"
Expand Down Expand Up @@ -888,6 +889,12 @@
"Npgsql": "10.0.3"
}
},
"OpenTelemetry.Api": {
"type": "CentralTransitive",
"requested": "[1.17.0, )",
"resolved": "1.17.0",
"contentHash": "mSBxzomZgHIJu9CyVNqyDu/n2JHEtqVgfcCD1Br0cV5iLYogjZOMqhlVLt99PEp+0KGBNUR3GXgeOdN2GR3F9g=="
},
"Polly": {
"type": "CentralTransitive",
"requested": "[8.7.0, 8.7.0]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ private static PnsHandle DeserializeHandle(string pnsHandle)
var value = tokens[1];

return new PnsHandle(platform, value);
;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@
"Microsoft.Extensions.Identity.Core": "[10.0.10, 10.0.10]",
"Microsoft.Extensions.Logging": "[10.0.10, 10.0.10]",
"Npgsql.EntityFrameworkCore.PostgreSQL": "[10.0.3, 10.0.3]",
"OpenTelemetry.Api": "[1.17.0, )",
"Polly": "[8.7.0, 8.7.0]",
"RabbitMQ.Client": "[7.2.1, 7.2.1]",
"Serilog": "[4.4.0, 4.4.0]"
Expand Down Expand Up @@ -882,6 +883,12 @@
"Npgsql": "10.0.3"
}
},
"OpenTelemetry.Api": {
"type": "CentralTransitive",
"requested": "[1.17.0, )",
"resolved": "1.17.0",
"contentHash": "mSBxzomZgHIJu9CyVNqyDu/n2JHEtqVgfcCD1Br0cV5iLYogjZOMqhlVLt99PEp+0KGBNUR3GXgeOdN2GR3F9g=="
},
"Polly": {
"type": "CentralTransitive",
"requested": "[8.7.0, 8.7.0]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Backbone.BuildingBlocks.Application.Abstractions.Infrastructure.UserContext;
using Backbone.BuildingBlocks.Application.Abstractions.Exceptions;
using Backbone.BuildingBlocks.Application.Abstractions.Infrastructure.UserContext;
using Backbone.DevelopmentKit.Identity.ValueObjects;

namespace Backbone.AdminApi.Authentication;
Expand All @@ -7,7 +8,7 @@ public class AnonymousUserContext : IUserContext
{
public IdentityAddress GetAddress()
{
throw new NotSupportedException();
throw new NotFoundException();
}

public IdentityAddress? GetAddressOrNull()
Expand All @@ -17,7 +18,7 @@ public IdentityAddress GetAddress()

public DeviceId GetDeviceId()
{
throw new NotSupportedException();
throw new NotFoundException();
}

public DeviceId? GetDeviceIdOrNull()
Expand All @@ -27,27 +28,27 @@ public DeviceId GetDeviceId()

public string GetUserId()
{
throw new NotSupportedException();
throw new NotFoundException();
}

public string? GetUserIdOrNull()
{
throw new NotSupportedException();
return null;
}

public string GetUsername()
{
throw new NotSupportedException();
throw new NotFoundException();
}

public string? GetUsernameOrNull()
{
throw new NotSupportedException();
return null;
}

public string GetClientId()
{
throw new NotSupportedException();
throw new NotFoundException();
}

public string? GetClientIdOrNull()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ namespace Backbone.AdminApi.Configuration;

public class AdminApiConfiguration
{
[Required]
public required TelemetryConfiguration Telemetry { get; init; }

[Required]
public required AuthenticationConfiguration Authentication { get; init; }

Expand All @@ -18,6 +21,11 @@ public class AdminApiConfiguration
[Required]
public required InfrastructureConfiguration Infrastructure { get; init; }

public class TelemetryConfiguration
{
public required OpenTelemetryCollectorConfiguration OpenTelemetryCollector { get; set; } = new();
}

public class AuthenticationConfiguration
{
[Required]
Expand Down
21 changes: 10 additions & 11 deletions Applications/AdminApi/src/AdminApi/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Reflection;
using Autofac.Extensions.DependencyInjection;
using Backbone.AdminApi.Authentication;
using Backbone.AdminApi.Configuration;
Expand Down Expand Up @@ -73,14 +74,14 @@ static WebApplication CreateApp(string[] args)

builder.Host
.UseSerilog((context, configuration) => configuration
.ReadFrom.Configuration(context.Configuration, new ConfigurationReaderOptions { SectionName = "Logging" })
.Enrich.WithCorrelationId("X-Correlation-Id", addValueIfHeaderAbsence: true)
.Enrich.FromLogContext()
.Enrich.WithProperty("service", "adminui")
.Enrich.WithExceptionDetails(new DestructuringOptionsBuilder()
.WithDefaultDestructurers()
.WithDestructurers([new DbUpdateExceptionDestructurer()]))
.Enrich.WithSensitiveDataMasking(options => options.AddSensitiveDataMasks()), preserveStaticLogger: true)
.ReadFrom.Configuration(context.Configuration, new ConfigurationReaderOptions { SectionName = "Telemetry:Logging" })
.Enrich.WithCorrelationId("X-Correlation-Id", addValueIfHeaderAbsence: true)
.Enrich.FromLogContext()
.Enrich.WithExceptionDetails(new DestructuringOptionsBuilder()
.WithDefaultDestructurers()
.WithDestructurers([new DbUpdateExceptionDestructurer()]))
.Enrich.WithSensitiveDataMasking(options => options.AddSensitiveDataMasks()),
writeToProviders: true)
.UseServiceProviderFactory(new AutofacServiceProviderFactory());

ConfigureServices(builder.Services, builder.Configuration, builder.Environment);
Expand Down Expand Up @@ -133,7 +134,7 @@ static void ConfigureServices(IServiceCollection services, IConfiguration config
options.ReplaceApplicationStore<CustomOpenIddictEntityFrameworkCoreApplication, CustomOpenIddictEntityFrameworkCoreApplicationStore>();
});

services.AddOpenTelemetryWithPrometheusExporter(METER_NAME);
services.AddOpenTelemetry(METER_NAME, Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "unknown", parsedConfiguration.Telemetry.OpenTelemetryCollector);

services.AddTransient<IQuotaChecker, AlwaysSuccessQuotaChecker>();

Expand All @@ -158,8 +159,6 @@ static void Configure(WebApplication app, AdminApiConfiguration configuration)
if (configuration.SwaggerUi.Enabled)
app.UseCustomSwaggerUi();

app.MapPrometheusScrapingEndpoint();

// the following headers are necessary to run the application in webassembly mode
app.Use(async (context, next) =>
{
Expand Down
28 changes: 15 additions & 13 deletions Applications/AdminApi/src/AdminApi/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,21 @@
}
}
},
"Logging": {
"MinimumLevel": {
"Default": "Warning",
"Override": {
"Backbone": "Information",
"Azure.Messaging.ServiceBus": "Error"
}
},
"WriteTo": {
"Console": {
"Name": "Console",
"Args": {
"formatter": "Serilog.Formatting.Compact.CompactJsonFormatter, Serilog.Formatting.Compact"
"Telemetry": {
"Logging": {
"MinimumLevel": {
"Default": "Warning",
"Override": {
"Backbone": "Information",
"Azure.Messaging.ServiceBus": "Error"
}
},
"WriteTo": {
"Console": {
"Name": "Console",
"Args": {
"formatter": "Serilog.Formatting.Compact.CompactJsonFormatter, Serilog.Formatting.Compact"
}
}
}
}
Expand Down
Loading