Add webhook support for card transactions and notifications.
Java CI / build (push) Successful in 50s
.NET+Docker CI/CD / Unit and Integration tests (push) Successful in 33s
.NET+Docker CI/CD / Push Docker image to ghcr.io (push) Failing after 30s

Some optimizations and fixes

Signed-off-by: Dmitrii <computer@yawaflua.tech>

Took 2 hours 4 minutes
This commit is contained in:
Dmitrii
2026-07-12 06:27:28 +03:00
parent 0e53d7dd8c
commit f19a5d3586
37 changed files with 1155 additions and 950 deletions
+24 -4
View File
@@ -3,6 +3,8 @@ using System.Text;
using Microsoft.AspNetCore.Authorization;
using Microsoft.EntityFrameworkCore;
using MongoDB.Driver;
using OpenTelemetry.Exporter;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using SpMega.Backend.Authetication;
@@ -68,7 +70,10 @@ public class Program
options.UseMongoDB(mongoClient, "spmega");
});
var otlpEndpoint = conf["Otlp:Endpoint"] ?? "http://localhost:4317";
var otlpEndpoint = (conf["Otlp__Endpoint"] ?? "http://curiosity:5080/api/default").TrimEnd('/');
var otlpHeaders = conf["Otlp__Headers"] ?? throw new InvalidOperationException("Otlp__Headers is not configured.");
var tracesEndpoint = new Uri($"{otlpEndpoint}/v1/traces");
var metricsEndpoint = new Uri($"{otlpEndpoint}/v1/metrics");
builder.Services.AddOpenTelemetry()
.ConfigureResource(res => res.AddService("SpMega.Backend"))
.WithTracing(tracing =>
@@ -79,9 +84,24 @@ public class Program
.AddAspNetCoreInstrumentation()
.AddOtlpExporter(opts =>
{
opts.Endpoint = new Uri(otlpEndpoint);
opts.Protocol = OtlpExportProtocol.HttpProtobuf;
opts.Endpoint = tracesEndpoint;
opts.Headers = otlpHeaders;
});
});
})
.WithMetrics(metrics => metrics
.AddAspNetCoreInstrumentation()
.AddMeter(
"Microsoft.AspNetCore.Hosting",
"Microsoft.AspNetCore.Server.Kestrel",
"System.Net.Http",
"System.Runtime")
.AddOtlpExporter(opts =>
{
opts.Protocol = OtlpExportProtocol.HttpProtobuf;
opts.Endpoint = metricsEndpoint;
opts.Headers = otlpHeaders;
}));
var app = builder.Build();
@@ -113,4 +133,4 @@ public class Program
return result.ToString();
}
}
}