diff --git a/sources/App/Directory.Packages.props b/sources/App/Directory.Packages.props
index dd84ad804efbe3499e71054da337cccb023aa250..2656bc215f8e803aab26a36d404c10ff72745051 100644
--- a/sources/App/Directory.Packages.props
+++ b/sources/App/Directory.Packages.props
@@ -4,7 +4,7 @@
     <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
   </PropertyGroup>
   <PropertyGroup Label="iRIS Packages Versions">
-    <iRISFrameworkVersion>0.114.56</iRISFrameworkVersion>
+    <iRISFrameworkVersion>0.114.59</iRISFrameworkVersion>
   </PropertyGroup>
   <ItemGroup Label="iRIS Framework Packages">
     <PackageVersion Include="iRIS.Framework.Hosting.Core" Version="$(iRISFrameworkVersion)" />
@@ -15,6 +15,7 @@
     <PackageVersion Include="iRIS.Framework.Hosting.Abstractions" Version="$(iRISFrameworkVersion)" />
     <PackageVersion Include="Pfc.PolicyNumberGeneratorClient" Version="1.0.0" />
     <PackageVersion Include="Pfc.SegmentationServiceClient" Version="1.0.0" />
+    <PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="9.0.2" />
     <PackageVersion Include="System.ServiceModel.Duplex" Version="6.0.0" />
     <PackageVersion Include="System.ServiceModel.Federation" Version="6.0.0" />
     <PackageVersion Include="System.ServiceModel.Http" Version="6.0.0" />
@@ -22,7 +23,7 @@
     <PackageVersion Include="System.ServiceModel.Security" Version="6.0.0" />
   </ItemGroup>
   <ItemGroup Label="Clients Packages">
-    <PackageVersion Include="SasClient" Version="1.1.21" />
+    <PackageVersion Include="SasClient" Version="1.1.24" />
   </ItemGroup>
   <ItemGroup Label="EF Core Packages">
     <PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
@@ -43,7 +44,7 @@
   <ItemGroup>
     <PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
     <PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
-    <PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.0" />
+    <PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.1" />
     <PackageVersion Include="Swashbuckle.AspNetCore" Version="6.7.0" />
     <PackageVersion Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
     <PackageVersion Include="Swashbuckle.AspNetCore.Filters.Abstractions" Version="8.0.2" />
@@ -58,4 +59,4 @@
   <ItemGroup Label="Tests Result Reporters">
     <PackageVersion Include="JunitXml.TestLogger" Version="3.1.12" />
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/sources/App/NuGet.config b/sources/App/NuGet.config
index a2f4c592cd2b4ad49b2cae2f42465df5eee40c97..da7cdf6be20ddf0bfb10a63417353c70648946c3 100644
--- a/sources/App/NuGet.config
+++ b/sources/App/NuGet.config
@@ -1,7 +1,7 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <packageSources>
     <clear />
-    <add key="iRIS RENINS" value="http://ren-msktfs01.mos.renins.com:8624/nuget/NugetFeed/" />
+    <add key="iRIS RENINS" value="http://ren-msktfs01.mos.renins.com:8624/nuget/NugetFeed/" allowInsecureConnections="true" />
   </packageSources>
-</configuration>
\ No newline at end of file
+</configuration>
diff --git a/sources/App/iRIS.KaskoInsuranceFactory.sln b/sources/App/iRIS.KaskoInsuranceFactory.sln
index b5034c665c3570009b197be9e79501dbd28ff0a0..617f2629ea03365edd350761e166ad7a2c404d4f 100644
--- a/sources/App/iRIS.KaskoInsuranceFactory.sln
+++ b/sources/App/iRIS.KaskoInsuranceFactory.sln
@@ -85,6 +85,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdGenerator", "src\Modules\
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdGenerator.Tests", "src\Modules\BusinessLogic\PolicyDraftGeneration\IdGenerator.Tests\IdGenerator.Tests.csproj", "{9A8C199F-93D4-43D3-BA06-D1311EE4E08D}"
 EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "System", "System", "{89EB2343-3CBE-4779-8ED6-8389A1381499}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Metrics", "Metrics", "{895CCC59-BD4B-49EE-B95B-B18A05E6D574}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Metrics", "src\Modules\Metrics\App\Metrics.csproj", "{9FB93B42-1EAE-4E31-9C0B-437C35E8CC26}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -175,6 +181,10 @@ Global
 		{9A8C199F-93D4-43D3-BA06-D1311EE4E08D}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{9A8C199F-93D4-43D3-BA06-D1311EE4E08D}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{9A8C199F-93D4-43D3-BA06-D1311EE4E08D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{9FB93B42-1EAE-4E31-9C0B-437C35E8CC26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{9FB93B42-1EAE-4E31-9C0B-437C35E8CC26}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{9FB93B42-1EAE-4E31-9C0B-437C35E8CC26}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{9FB93B42-1EAE-4E31-9C0B-437C35E8CC26}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -213,6 +223,9 @@ Global
 		{3F275629-5F71-4B3B-B70E-7ADFA66D65FF} = {03DBB00E-C314-4927-BF14-D67AF84AF37C}
 		{6CF714EE-4271-430C-AD3D-23847565F4F0} = {3F275629-5F71-4B3B-B70E-7ADFA66D65FF}
 		{9A8C199F-93D4-43D3-BA06-D1311EE4E08D} = {3F275629-5F71-4B3B-B70E-7ADFA66D65FF}
+		{89EB2343-3CBE-4779-8ED6-8389A1381499} = {004E1BB1-C4A0-406F-B41F-52230EFF3E32}
+		{895CCC59-BD4B-49EE-B95B-B18A05E6D574} = {89EB2343-3CBE-4779-8ED6-8389A1381499}
+		{9FB93B42-1EAE-4E31-9C0B-437C35E8CC26} = {895CCC59-BD4B-49EE-B95B-B18A05E6D574}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {D05DF2A3-4C91-4433-8BE3-74BA049735C2}
diff --git a/sources/App/src/Hosts/Api/Api.csproj b/sources/App/src/Hosts/Api/Api.csproj
index e828344f83aa2b85b402ea90d749673d981ce427..eed648428eb14ad75e1fc9e6817875e6191e3dbd 100644
--- a/sources/App/src/Hosts/Api/Api.csproj
+++ b/sources/App/src/Hosts/Api/Api.csproj
@@ -15,6 +15,7 @@
     <ProjectReference Include="..\..\Modules\Main\Application\Application.csproj" />
     <ProjectReference Include="..\..\Modules\Main\DTO\DTO.csproj" />
     <ProjectReference Include="..\..\Modules\Main\Infrastructure\Infrastructure.csproj" />
+    <ProjectReference Include="..\..\Modules\Metrics\App\Metrics.csproj" />
   </ItemGroup>
 
   <ItemGroup>
@@ -24,6 +25,7 @@
     <PackageReference Include="Swashbuckle.AspNetCore" />
     <PackageReference Include="Swashbuckle.AspNetCore.Filters.Abstractions" />
     <PackageReference Include="Swashbuckle.AspNetCore.Filters" />
+    <PackageReference Include="System.Diagnostics.DiagnosticSource" />
   </ItemGroup>
 
   <ItemGroup>
diff --git a/sources/App/src/Hosts/Api/Controllers/ApiKaskoFactoryController.cs b/sources/App/src/Hosts/Api/Controllers/ApiKaskoFactoryController.cs
index 0b444ccda352750c938fe220be40a5d786844777..677fa57b6e01a09813ddfadc339af75c2d5136a3 100644
--- a/sources/App/src/Hosts/Api/Controllers/ApiKaskoFactoryController.cs
+++ b/sources/App/src/Hosts/Api/Controllers/ApiKaskoFactoryController.cs
@@ -7,7 +7,6 @@ using KaskoInsuranceFactory.Main.Application.Implementation.Processes.Calculatio
 using KaskoInsuranceFactory.Main.Application.Interfaces.Pipeline;
 using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Calculation.Request;
 using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Calculation.Response;
-using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos;
 using Microsoft.AspNetCore.Mvc;
 using Swashbuckle.AspNetCore.Filters;
 
diff --git a/sources/App/src/Hosts/Api/Middleware/RequestResponseLoggingMiddleware.cs b/sources/App/src/Hosts/Api/Middleware/RequestResponseLoggingMiddleware.cs
index 74e32dfb390e3cf323c2955872d41e4ebb035345..08475c2d2686757b3699ded240120c97a2652579 100644
--- a/sources/App/src/Hosts/Api/Middleware/RequestResponseLoggingMiddleware.cs
+++ b/sources/App/src/Hosts/Api/Middleware/RequestResponseLoggingMiddleware.cs
@@ -1,8 +1,14 @@
 using iRIS.Framework.CrossCutting.Logging;
 using KaskoInsuranceFactory.Main.Application.Constants.Logging;
+using Metrics.Wrapper;
 using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http.Extensions;
+using Polly;
 using Serilog.Context;
+using System;
+using System.Collections.Generic;
 using System.Diagnostics;
+using System.Diagnostics.Metrics;
 using System.IO;
 using System.Threading.Tasks;
 
@@ -12,6 +18,8 @@ public class RequestResponseLoggingMiddleware
 {
     private readonly RequestDelegate _next;
 
+    private long _totalTime;
+
     private static readonly PathString _apiPathString = new PathString("/api");
 
     public RequestResponseLoggingMiddleware(RequestDelegate next)
@@ -19,7 +27,7 @@ public class RequestResponseLoggingMiddleware
         _next = next;
     }
 
-    public async Task Invoke(HttpContext context, ILogger logger)
+    public async Task Invoke(HttpContext context, ILogger logger, ICustomMetrics metrics)
     {
         if (!context.Request.Path.StartsWithSegments(_apiPathString))
         {
@@ -44,17 +52,21 @@ public class RequestResponseLoggingMiddleware
         }
         finally
         {
+            stopWatch.Stop();
+            _totalTime = stopWatch.ElapsedMilliseconds;
             using (LogContext.PushProperty(LogItems.ProcessKeyItem, context.Items[LogItems.ProcessKeyItem]))
             using (LogContext.PushProperty(LogItems.HttpRequestBodyContent, await ReadRequestBodyAsync(context)))
             using (LogContext.PushProperty(LogItems.HttpResponseBodyContent, await ReadResponseBodyAsync(context)))
             using (LogContext.PushProperty(LogItems.StatusCode, context.Response.StatusCode))
-            using (LogContext.PushProperty(LogItems.TotalTimeItem, stopWatch.ElapsedMilliseconds))
+            using (LogContext.PushProperty(LogItems.TotalTimeItem, _totalTime))
             {
                 logger.Information("Обработан запрос в пайплайне.");
             }
 
             await responseBody.CopyToAsync(originalBodyStream);
             context.Response.Body = originalBodyStream;
+
+            metrics.RecordHistogram(MetricLabels.RequestTotalTimeBackets, _totalTime);
         }
     }
 
diff --git a/sources/App/src/Hosts/Api/Program.cs b/sources/App/src/Hosts/Api/Program.cs
index 9fd99a1125b02343cee9c5a93c0f7200f931b39f..ccc9c85b848030dee9b4fe6582e28a46d48c43b0 100644
--- a/sources/App/src/Hosts/Api/Program.cs
+++ b/sources/App/src/Hosts/Api/Program.cs
@@ -11,6 +11,7 @@ public static class Program
     {
         var hostRunner = new MigrationHostRunner<Startup, AppDbContext>(args);
         hostRunner.ConfigureMetrics(builder => builder.AddMeter("Npgsql"));
+        hostRunner.ConfigureMetrics(builder => builder.AddMeter("KaskoInsuranceFactory.Main"));
         hostRunner.ConfigureTracing(builder => builder.AddSource("Npgsql"));
 
         return await hostRunner.Run(args);
diff --git a/sources/App/src/Hosts/Api/Startup.cs b/sources/App/src/Hosts/Api/Startup.cs
index 4ecdd5c8e7dd488dc79a2f683ac7a849137e65cb..8839b174d1a836bafb64b196998f3dcb09817900 100644
--- a/sources/App/src/Hosts/Api/Startup.cs
+++ b/sources/App/src/Hosts/Api/Startup.cs
@@ -5,6 +5,7 @@ using Swashbuckle.AspNetCore.Filters;
 using IdGenerator;
 using PolicyNumberGeneration;
 using KaskoChecks;
+using iRIS.Framework.Hosting.Core.HealthChecks;
 using KaskoInsuranceFactory.Api.Configurators;
 using KaskoInsuranceFactory.Api.Middleware;
 using KaskoInsuranceFactory.Main.Application;
@@ -22,6 +23,17 @@ using Segmentation;
 using System.Reflection;
 using System;
 using System.Text.Json.Serialization;
+using System.Diagnostics.Metrics;
+using Segmentation.Implementation;
+using Metrics.Wrapper;
+using Metrics.HttpClient;
+using KaskoChecks.CheckServices;
+using BlackList.Client;
+using Microsoft.Extensions.Options;
+using Pfc.PolicyNumberGeneratorClient.Client;
+using Pfc.SegmentationServiceClient.Client;
+using Pfc.DataStructureServiceClient.Client;
+using SasClient.Connected_Services.CheckProlongation;
 
 namespace KaskoInsuranceFactory.Api;
 
@@ -44,6 +56,8 @@ public class Startup
                 options.JsonSerializerOptions.WriteIndented = true; // Для читаемости
             });
 
+        services.AddHttpClient();
+
         services.AddMemoryCache();
 
         services.AddPostgreStorage(Configuration);
@@ -65,6 +79,8 @@ public class Startup
         services.AddSegmentation(Configuration);
         services.AddPolicyNumberGeneration(Configuration);
 
+        services.AddSingleton<ICustomMetrics, CustomMetrics>();
+
         MapperConfigurator.Configure(services);
     }
 
@@ -91,15 +107,7 @@ public class Startup
         {
             endpoints.MapControllers();
 
-            endpoints.MapHealthChecks("/hc", new HealthCheckOptions()
-            {
-                Predicate = _ => true,
-                ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
-            });
-            endpoints.MapHealthChecks("/liveness", new HealthCheckOptions
-            {
-                Predicate = r => r.Name.Contains("self")
-            });
+            endpoints.SetupHealthChecks();
         });
     }
 
@@ -109,5 +117,10 @@ public class Startup
         containerBuilder.RegisterModule(new ScoringModule(Configuration));
         containerBuilder.RegisterModule(new IdGeneratorModule(Configuration));
         containerBuilder.RegisterModule(new KaskoChecksModule(Configuration));
+
+        containerBuilder.AddHttpClientMetrics<SegmentationServiceClient>(Configuration);
+        containerBuilder.AddHttpClientMetrics<DataStructureServiceClient>(Configuration);
+        containerBuilder.AddHttpClientMetrics<PolicyNumberGeneratorClient>(Configuration);
+        containerBuilder.AddHttpClientMetrics<CheckProlongationClient>(Configuration);
     }
 }
diff --git a/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator.Tests/IdGenerator.Tests.csproj b/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator.Tests/IdGenerator.Tests.csproj
index 75b7c2b6248d88fa9396c00a6913efee18cab613..5da0796618868b3e0a45c7a0620f4323f3b7438e 100644
--- a/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator.Tests/IdGenerator.Tests.csproj
+++ b/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator.Tests/IdGenerator.Tests.csproj
@@ -19,6 +19,7 @@
   </ItemGroup>
 
   <ItemGroup>
+    <ProjectReference Include="..\..\..\Metrics\App\Metrics.csproj" />
     <ProjectReference Include="..\IdGenerator\IdGenerator.csproj" />
   </ItemGroup>
 
diff --git a/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator.Tests/PolicyDraftKeyGeneratorTests.cs b/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator.Tests/PolicyDraftKeyGeneratorTests.cs
index 4c8d3e7fdfe9e685b82b98aac2cb71e594963ed7..99e6cf68bf0fd5cd1c41d56851e562bffd96b1b1 100644
--- a/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator.Tests/PolicyDraftKeyGeneratorTests.cs
+++ b/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator.Tests/PolicyDraftKeyGeneratorTests.cs
@@ -1,16 +1,19 @@
+using System.Diagnostics.Metrics;
 using Client.IdGenerator;
 using IdGenerator;
 using IdGenerator.Implementation;
+using Metrics.Wrapper;
 using Microsoft.Extensions.Options;
 using Moq;
 using NUnit.Framework;
 
-namespace KaskoInsuranceFactory.Main.Tests.Code.Implementation;
+namespace IdGenerator.Tests;
 public class PolicyDraftKeyGeneratorTests
 {
     private Mock<IServiceProvider> _serviceProviderMock;
     private Mock<IOptions<IdGeneratorModuleConfiguration>> _optionsMock;
     private Mock<IdGeneratorSoap> _idGeneratorSoapMock;
+    private Mock<ICustomMetrics> _metricsMock;
     private PolicyDraftKeyGenerator _policyDraftKeyGenerator;
 
     [SetUp]
@@ -19,7 +22,7 @@ public class PolicyDraftKeyGeneratorTests
         _serviceProviderMock = new Mock<IServiceProvider>();
         _optionsMock = new Mock<IOptions<IdGeneratorModuleConfiguration>>();
         _idGeneratorSoapMock = new Mock<IdGeneratorSoap>();
-
+        _metricsMock = new Mock<ICustomMetrics>();
 
         var configuration = new IdGeneratorModuleConfiguration
         {
@@ -34,7 +37,11 @@ public class PolicyDraftKeyGeneratorTests
         _serviceProviderMock.Setup(sp => sp.GetService(typeof(IdGeneratorSoap)))
             .Returns(_idGeneratorSoapMock.Object);
 
-        _policyDraftKeyGenerator = new PolicyDraftKeyGenerator(_serviceProviderMock.Object);
+        _metricsMock.Setup(x => x.CreateGauge(It.IsAny<string>(), It.IsAny<Func<IEnumerable<Measurement<long>>>>()));
+        _metricsMock.Setup(x => x.RecordCounter(It.IsAny<string>(), It.IsAny<long>()));
+        _metricsMock.Setup(x => x.RecordHistogram(It.IsAny<string>(), It.IsAny<long>()));
+
+        _policyDraftKeyGenerator = new PolicyDraftKeyGenerator(_serviceProviderMock.Object, _metricsMock.Object);
     }
 
     [Test]
@@ -71,4 +78,24 @@ public class PolicyDraftKeyGeneratorTests
         Assert.That(result, Is.EqualTo(expectedId));
         _idGeneratorSoapMock.Verify(client => client.GenerateIdAsync(It.IsAny<GenerateIdRequest>()), Times.Once);
     }
+
+    [Test]
+    public async Task GenerateNumberAsync_WhenGenerateCustomIdIsFalse_ShouldCallRecordMetricsClient()
+    {
+        // Arrange
+        var expectedId = "some-generated-id";
+        var generateIdResponse = new GenerateIdResponse
+        {
+            Body = new GenerateIdResponseBody { GenerateIdResult = expectedId }
+        };
+        _idGeneratorSoapMock.Setup(client => client.GenerateIdAsync(It.IsAny<GenerateIdRequest>()))
+            .ReturnsAsync(generateIdResponse);
+
+        // Act
+        var result = await _policyDraftKeyGenerator.GenerateAsync();
+
+        // Assert
+        Assert.That(result, Is.EqualTo(expectedId));
+        _metricsMock.Verify(client => client.RecordHistogram(It.IsAny<string>(), It.IsAny<long>()), Times.Once);
+    }
 }
diff --git a/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/IdGenerator.csproj b/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/IdGenerator.csproj
index cb566d947a2a77a9856fe87558c2ce71fc9bb82c..edc0bba18bbe6f1cfac686fb1faab415630512c4 100644
--- a/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/IdGenerator.csproj
+++ b/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/IdGenerator.csproj
@@ -14,4 +14,8 @@
     <PackageReference Include="System.ServiceModel.Security" />
   </ItemGroup>
 
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\Metrics\App\Metrics.csproj" />
+  </ItemGroup>
+
 </Project>
diff --git a/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/IdGeneratorModule.cs b/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/IdGeneratorModule.cs
index 3109c872dc57c4c818eeb591a70855a411683ccf..9709bbc2b48e0fc6166f181921489515efb4ea08 100644
--- a/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/IdGeneratorModule.cs
+++ b/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/IdGeneratorModule.cs
@@ -5,6 +5,7 @@ using IdGenerator.Implementation;
 using IdGenerator.Interfaces;
 using iRIS.Framework.Common;
 using iRIS.Framework.CrossCutting.Wcf.Tracing;
+using Metrics.Wcf;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Options;
 
@@ -26,7 +27,6 @@ public class IdGeneratorModule : Module
 
         containerBuilder.RegisterType<PolicyDraftKeyGenerator>().As<IPolicyDraftKeyGenerator>();
         RegistryWcfIdGeneratorSoapClient(containerBuilder);
-
     }
 
     private void RegistryWcfIdGeneratorSoapClient(ContainerBuilder builder)
diff --git a/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/Implementation/PolicyDraftKeyGenerator.cs b/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/Implementation/PolicyDraftKeyGenerator.cs
index 2da746ec721a17a6242a63a1fca78bd1cb45c860..38752f6f3b7a88e2109e7a7a9bb7a69f4ea330f6 100644
--- a/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/Implementation/PolicyDraftKeyGenerator.cs
+++ b/sources/App/src/Modules/BusinessLogic/PolicyDraftGeneration/IdGenerator/Implementation/PolicyDraftKeyGenerator.cs
@@ -1,18 +1,23 @@
+using System.Diagnostics;
 using Client.IdGenerator;
 using IdGenerator.Interfaces;
 using iRIS.Framework.Common;
 using iRIS.Framework.CrossCutting.Wcf.Extensions;
+using Metrics.Wrapper;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Options;
+using OpenTelemetry.Metrics;
 
 namespace IdGenerator.Implementation;
 public class PolicyDraftKeyGenerator : IPolicyDraftKeyGenerator
 {
     private readonly IServiceProvider _serviceProvider;
+    private readonly ICustomMetrics _metrics;
 
-    public PolicyDraftKeyGenerator(IServiceProvider serviceProvider)
+    public PolicyDraftKeyGenerator(IServiceProvider serviceProvider, ICustomMetrics metrics)
     {
         _serviceProvider = serviceProvider;
+        _metrics = metrics;
     }
 
     public async Task<string> GenerateAsync()
@@ -30,7 +35,9 @@ public class PolicyDraftKeyGenerator : IPolicyDraftKeyGenerator
 
         var id = await client.Using(async client =>
         {
+            var sw = Stopwatch.StartNew();
             var response = await client.GenerateIdAsync(new GenerateIdRequest());
+            _metrics.RecordHistogram(MetricLabels.DependencyTotalTimeBackets(client.GetType().Name), sw.ElapsedMilliseconds);
             return response.Body.GenerateIdResult;
         });
 
diff --git a/sources/App/src/Modules/BusinessLogic/PolicyNumberGeneration/PolicyNumberGeneration/PolicyNumberGenHostingExtensions.cs b/sources/App/src/Modules/BusinessLogic/PolicyNumberGeneration/PolicyNumberGeneration/PolicyNumberGenHostingExtensions.cs
index 8dc35aac272c2fd115a307b542451909b43e9d5f..34d313aa8b345a46781cd010ab73f5e8e5ef0bbd 100644
--- a/sources/App/src/Modules/BusinessLogic/PolicyNumberGeneration/PolicyNumberGeneration/PolicyNumberGenHostingExtensions.cs
+++ b/sources/App/src/Modules/BusinessLogic/PolicyNumberGeneration/PolicyNumberGeneration/PolicyNumberGenHostingExtensions.cs
@@ -1,6 +1,8 @@
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Options;
 using Pfc.PolicyNumberGeneratorClient;
+using Pfc.PolicyNumberGeneratorClient.Client;
 using PolicyNumberGeneration.Implementation;
 using PolicyNumberGeneration.Interfaces;
 
@@ -12,6 +14,20 @@ public static class PolicyNumberGenHostingExtensions
             IConfiguration configuration)
     {
         PolicyNumberGeneratorClientModule.PolicyNumberGeneratorClientRegister(serviceCollection, configuration);
+
+        serviceCollection.Configure<PolicyNumberGeneratorClientConfiguration>(configuration.GetSection("PolicyNumberGeneratorService"));
+
+        serviceCollection.AddScoped<IPolicyNumberGeneratorClient, PolicyNumberGeneratorClient>(sp =>
+        {
+            var factory = sp.GetService<IHttpClientFactory>();
+            var httpClient = factory.CreateClient(nameof(PolicyNumberGeneratorClient));
+
+            var currentValue = sp.GetRequiredService<IOptionsMonitor<PolicyNumberGeneratorClientConfiguration>>().CurrentValue;
+            httpClient.BaseAddress = new Uri(currentValue.PolicyNumberGeneratorServiceUrl);
+
+            return new PolicyNumberGeneratorClient(httpClient);
+        });
+
         serviceCollection.AddScoped<IPolicyNumberGenerator, PolicyNumberGenerator>();
 
         return serviceCollection;
diff --git a/sources/App/src/Modules/BusinessLogic/Segmentation/Segmentation/SegmentationHostingExtensions.cs b/sources/App/src/Modules/BusinessLogic/Segmentation/Segmentation/SegmentationHostingExtensions.cs
index ec777f0ddfb682055cb1daf02ace289fdeb0dc2f..43b2a2a742e28c98a6d8dfd97a1a15d5126a722c 100644
--- a/sources/App/src/Modules/BusinessLogic/Segmentation/Segmentation/SegmentationHostingExtensions.cs
+++ b/sources/App/src/Modules/BusinessLogic/Segmentation/Segmentation/SegmentationHostingExtensions.cs
@@ -1,10 +1,17 @@
+using Autofac.Core;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Options;
 using Pfc.DataMapper;
 using Pfc.DataStructureServiceClient;
+using Pfc.DataStructureServiceClient.Client;
+using Pfc.DataStructureServiceClient.Client.Abstractions;
 using Pfc.SegmentationServiceClient;
+using Pfc.SegmentationServiceClient.Client;
+using Pfc.SegmentationServiceClient.Interfaces;
 using Segmentation.Implementation;
 using Segmentation.Interfaces;
+using Serilog;
 
 namespace Segmentation;
 public static class SegmentationHostingExtensions
@@ -14,11 +21,41 @@ public static class SegmentationHostingExtensions
                 IConfiguration configuration)
     {
         serviceCollection.DataMapperRegister(configuration);
-        serviceCollection.DataStructureServiceClientRegister(configuration);
-        serviceCollection.SegmentationServiceClientRegister(configuration);
+        RegisterDataStructureServiceClient(serviceCollection, configuration);
+        RegisterSegmentationServiceClient(serviceCollection, configuration);
         serviceCollection.AddScoped<ISegmentationService, SegmentationService>();
 
-
         return serviceCollection;
     }
+
+    private static void RegisterSegmentationServiceClient(IServiceCollection serviceCollection, IConfiguration configuration)
+    {
+        serviceCollection.Configure<DataStructureServiceConfiguration>(configuration.GetSection("DataStructureService"));
+
+        serviceCollection.AddScoped<IDataStructureServiceClient, DataStructureServiceClient>(sp =>
+        {
+            var factory = sp.GetService<IHttpClientFactory>();
+            var httpClient = factory.CreateClient(nameof(DataStructureServiceClient));
+
+            var currentValue = sp.GetRequiredService<IOptionsMonitor<DataStructureServiceConfiguration>>().CurrentValue;
+            httpClient.BaseAddress = new Uri(currentValue.DataStructureServiceUrl);
+
+            return new DataStructureServiceClient(httpClient);
+        });
+    }
+
+    private static void RegisterDataStructureServiceClient(IServiceCollection serviceCollection, IConfiguration configuration)
+    {
+        serviceCollection.Configure<SegmentationServiceConfiguration>(configuration.GetSection("SegmentationService"));
+        serviceCollection.AddScoped<ISegmentationServiceClient, SegmentationServiceClient>(sp =>
+        {
+            var factory = sp.GetService<IHttpClientFactory>();
+            var httpClient = factory.CreateClient(nameof(SegmentationServiceClient));
+
+            var currentValue = sp.GetRequiredService<IOptionsMonitor<SegmentationServiceConfiguration>>().CurrentValue;
+            httpClient.BaseAddress = new Uri(currentValue.SegmentationServiceUrl);
+
+            return new SegmentationServiceClient(httpClient, sp.GetRequiredService<IDataMapper>(), sp.GetRequiredService<ILogger>());
+        });
+    }
 }
diff --git a/sources/App/src/Modules/Integrations/BlackList/BlackList/BlackList.csproj b/sources/App/src/Modules/Integrations/BlackList/BlackList/BlackList.csproj
index 7c9f3ce0d5b2d73bed13735926d8e1c3d390afb9..53ee52f2381a03b9abf801d2ca3312c72b4e4bae 100644
--- a/sources/App/src/Modules/Integrations/BlackList/BlackList/BlackList.csproj
+++ b/sources/App/src/Modules/Integrations/BlackList/BlackList/BlackList.csproj
@@ -10,5 +10,9 @@
     <PackageReference Include="Autofac" />
     <PackageReference Include="iRIS.Framework.CrossCutting" />
   </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\Metrics\App\Metrics.csproj" />
+  </ItemGroup>
   
 </Project>
diff --git a/sources/App/src/Modules/Integrations/BlackList/BlackList/BlackListModule.cs b/sources/App/src/Modules/Integrations/BlackList/BlackList/BlackListModule.cs
index b98e8ca098f83b4349fb275e5225192d155e4118..2b89387a138adf3223cfbf6a22396ad0b6c1f570 100644
--- a/sources/App/src/Modules/Integrations/BlackList/BlackList/BlackListModule.cs
+++ b/sources/App/src/Modules/Integrations/BlackList/BlackList/BlackListModule.cs
@@ -4,6 +4,8 @@ using BlackList.Client;
 using iRIS.Framework.Common;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Options;
+using Metrics.Wrapper;
+using Metrics.HttpClient;
 
 namespace BlackList;
 
@@ -25,12 +27,14 @@ public class BlackListModule : Module
             var config = ctx.Resolve<IOptions<BlackListModuleConfiguration>>().Value;
             var httpClientFactory = ctx.Resolve<IHttpClientFactory>();
 
-            var httpClient = httpClientFactory.CreateClient();
+            var httpClient = httpClientFactory.CreateClient(nameof(BlackListClient));
             httpClient.BaseAddress = new Uri($"{config.BaseServiceUrl.TrimEnd('/')}/");
             httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", config.BasicAuthorizationHash);
             httpClient.Timeout = config.RequestTimeout;
 
             return new BlackListClient(httpClient, config.ClientServiceLogin);
         }).As<IBlackListClient>();
+
+        builder.AddHttpClientMetrics<BlackListClient>(_configuration);
     }
 }
diff --git a/sources/App/src/Modules/Main/Application/Application.csproj b/sources/App/src/Modules/Main/Application/Application.csproj
index 55ff14425e68b9fa6237ecb65c89f0ed53ae9b09..1d19e421b2dccdbc45824a3dcf33290ab9730d02 100644
--- a/sources/App/src/Modules/Main/Application/Application.csproj
+++ b/sources/App/src/Modules/Main/Application/Application.csproj
@@ -17,6 +17,7 @@
     <ProjectReference Include="..\..\BusinessLogic\PolicyNumberGeneration\PolicyNumberGeneration\PolicyNumberGeneration.csproj" />
     <ProjectReference Include="..\..\BusinessLogic\Scoring\Scoring\Scoring.csproj" />
     <ProjectReference Include="..\..\BusinessLogic\Segmentation\Segmentation\Segmentation.csproj" />
+    <ProjectReference Include="..\..\Metrics\App\Metrics.csproj" />
     <ProjectReference Include="..\DAL\DAL.csproj" />
     <ProjectReference Include="..\Domain\Domain.csproj" />
     <ProjectReference Include="..\DTO\DTO.csproj" />
diff --git a/sources/App/src/Modules/Main/Application/Base/Pipeline/BasePipelineStep.cs b/sources/App/src/Modules/Main/Application/Base/Pipeline/BasePipelineStep.cs
index cd8a0042ca2538bd5c4b8c6bc0ba567c259113b3..37bc3469e7a612b7991ad17e5b7917d6c3ef6e32 100644
--- a/sources/App/src/Modules/Main/Application/Base/Pipeline/BasePipelineStep.cs
+++ b/sources/App/src/Modules/Main/Application/Base/Pipeline/BasePipelineStep.cs
@@ -3,18 +3,22 @@ using System.Threading;
 using System.Threading.Tasks;
 using KaskoInsuranceFactory.Main.Application.Constants.Logging;
 using KaskoInsuranceFactory.Main.Application.Interfaces.Pipeline;
+using Metrics.Wrapper;
 using Serilog;
 
 namespace KaskoInsuranceFactory.Main.Application.Base.Pipeline;
 public abstract class BasePipelineStep : IPipelineStep
 {
     private readonly ILogger _logger;
-    Stopwatch _stopwatch;
-    bool _isAborted;
+    private Stopwatch _stopwatch;
+    private bool _isAborted;
 
-    protected BasePipelineStep(ILogger logger)
+    protected ICustomMetrics Metrics { get; private set; }
+
+    protected BasePipelineStep(ILogger logger, ICustomMetrics metrics)
     {
         _logger = logger;
+        Metrics = metrics;
     }
 
     protected abstract string LoggingKey { get; }
@@ -41,6 +45,8 @@ public abstract class BasePipelineStep : IPipelineStep
         _logger.ForContext(LogItems.ProcessKeyItem, LoggingKey)
             .ForContext(LogItems.TotalTimeItem, _stopwatch.ElapsedMilliseconds)
             .Information($"Завершена обработка шага {GetType().Name}");
+
+        Metrics.RecordHistogram(MetricLabels.StepTotalTimeBackets(GetType().Name), _stopwatch.ElapsedMilliseconds);
         return Task.CompletedTask;
     }
 
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/AutomaticChecksStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/AutomaticChecksStep.cs
index e69d3c5dfd03e218102a3eb601ae3e7ce60a64e3..bc00ba833684a2ab335c976f5170e841c08ba020 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/AutomaticChecksStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/AutomaticChecksStep.cs
@@ -9,26 +9,22 @@ using KaskoInsuranceFactory.Errors;
 using KaskoInsuranceFactory.Main.Application.Base.Pipeline;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
+using Metrics.Wrapper;
 using Serilog;
 
 namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.PipelineSteps;
 
-public class AutomaticChecksStep : BasePipelineStep
+public class AutomaticChecksStep(
+    CalculationPipelineExecutionContext executionContext,
+    ILogger logger, ICustomMetrics metrics,
+    IBlackListCheckService blackListCheckService) : BasePipelineStep(logger, metrics)
 {
-    private readonly CalculationPipelineExecutionContext _executionContext;
-    private readonly ILogger _logger;
-    private readonly IBlackListCheckService _blackListCheckService;
+    private readonly CalculationPipelineExecutionContext _executionContext = executionContext;
+    private readonly ILogger _logger = logger.ForContext(typeof(AutomaticChecksStep));
+    private readonly IBlackListCheckService _blackListCheckService = blackListCheckService;
 
     protected override string LoggingKey => _executionContext.PolicyDraft.PolicyDraftKey;
 
-    public AutomaticChecksStep(CalculationPipelineExecutionContext executionContext, ILogger logger, IBlackListCheckService blackListCheckService)
-        : base(logger)
-    {
-        _executionContext = executionContext;
-        _logger = logger.ForContext(typeof(AutomaticChecksStep));
-        _blackListCheckService = blackListCheckService;
-    }
-
     public override async Task ExecuteInternalAsync(CancellationToken cancellationToken = default)
     {
         try
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CalculationStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CalculationStep.cs
index 80f38a47dddf5b50760710fab77e2573321acd0b..7c50942fa0b625e645273c9f91ca8edf476435fe 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CalculationStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CalculationStep.cs
@@ -1,16 +1,22 @@
 using System;
+using System.Collections.Generic;
 using System.Diagnostics.CodeAnalysis;
+using System.Diagnostics.Metrics;
 using System.Threading;
 using System.Threading.Tasks;
 using KaskoInsuranceFactory.Main.Application.Base.Pipeline;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
+using Metrics.Wrapper;
 using Serilog;
 
 namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.PipelineSteps;
 
 [ExcludeFromCodeCoverage]
-public class CalculationStep(CalculationPipelineExecutionContext executionContext, ILogger logger) : BasePipelineStep(logger)
+public class CalculationStep(
+    CalculationPipelineExecutionContext executionContext,
+    ILogger logger,
+    ICustomMetrics metrics) : BasePipelineStep(logger, metrics)
 {
     private readonly CalculationPipelineExecutionContext _executionContext = executionContext;
     private readonly ILogger _logger = logger;
@@ -35,5 +41,6 @@ public class CalculationStep(CalculationPipelineExecutionContext executionContex
     private async Task Calculate(CalculationPipelineExecutionContext context)
     {
         context.PolicyDraft.FirstCalcDate = DateTime.UtcNow;
+        metrics.RecordCounter(MetricLabels.SuccessfullCalculation, 1);
     }
 }
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CheckProlongationStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CheckProlongationStep.cs
index 7cd61dd9039e88e58d473f9e6fb442fb01d1484b..f51df66859058c82a055e4750d7d2d65813003e1 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CheckProlongationStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CheckProlongationStep.cs
@@ -4,6 +4,7 @@ using System.Threading.Tasks;
 using KaskoInsuranceFactory.Main.Application.Base.Pipeline;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
+using Metrics.Wrapper;
 using Scoring.Constants;
 using Scoring.Services;
 using Serilog;
@@ -13,7 +14,8 @@ namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.Calcul
 public class CheckProlongationStep(
     CalculationPipelineExecutionContext executionContext,
     IProlongationService prolongationService,
-    ILogger logger) : BasePipelineStep(logger)
+    ILogger logger,
+    ICustomMetrics metrics) : BasePipelineStep(logger, metrics)
 {
     private readonly CalculationPipelineExecutionContext _executionContext = executionContext;
     private readonly IProlongationService _prolongationService = prolongationService;
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CreateContextInitStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CreateContextInitStep.cs
index 109e93908bd0376fb1cc300c9a0f0dc78512f714..94bad7e85a9cde05124ea53b97c8495dcb30fea0 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CreateContextInitStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/CreateContextInitStep.cs
@@ -11,6 +11,7 @@ using KaskoInsuranceFactory.Main.Application.Implementation.Processes.Calculatio
 using KaskoInsuranceFactory.Main.Application.Models;
 using KaskoInsuranceFactory.Main.Application.Services;
 using KaskoInsuranceFactory.Main.Domain.ManualEntities;
+using Metrics.Wrapper;
 using Microsoft.AspNetCore.Http;
 using Serilog;
 
@@ -32,8 +33,8 @@ public class CreateContextInitStep : BasePipelineStep
         IPolicyDraftKeyGenerator accountNumberGenerator,
         IPolicyDraftService draftService,
         IHttpContextAccessor contextAccessor,
-        ILogger logger)
-        : base(logger)
+        ILogger logger,
+        ICustomMetrics metrics) : base(logger, metrics)
     {
         _logger = logger;
         _mapper = mapper;
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/DiscountCalculationStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/DiscountCalculationStep.cs
index f52ba77752ae737b4ad62cfcf22efe1f1d6a411f..c76cfb0844d92bd57b5af1dc643f1a13df4886e0 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/DiscountCalculationStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/DiscountCalculationStep.cs
@@ -5,12 +5,13 @@ using System.Threading.Tasks;
 using KaskoInsuranceFactory.Main.Application.Base.Pipeline;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
+using Metrics.Wrapper;
 using Serilog;
 
 namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.PipelineSteps;
 
 [ExcludeFromCodeCoverage]
-public class DiscountCalculationStep(CalculationPipelineExecutionContext executionContext, ILogger logger) : BasePipelineStep(logger)
+public class DiscountCalculationStep(CalculationPipelineExecutionContext executionContext, ILogger logger, ICustomMetrics metrics) : BasePipelineStep(logger, metrics)
 {
     private readonly CalculationPipelineExecutionContext _executionContext = executionContext;
     private readonly ILogger _logger = logger;
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/GeneratePolicyNumberStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/GeneratePolicyNumberStep.cs
index fca56691cf27622e48d021177cb87cc68df7fabf..204479de5f16c5d95614c18029a49b15a29cb573 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/GeneratePolicyNumberStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/GeneratePolicyNumberStep.cs
@@ -5,12 +5,17 @@ using System.Threading.Tasks;
 using KaskoInsuranceFactory.Main.Application.Base.Pipeline;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
+using Metrics.Wrapper;
 using PolicyNumberGeneration.Interfaces;
 using Serilog;
 
 namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.PipelineSteps;
 [ExcludeFromCodeCoverage]
-public class GeneratePolicyNumberStep(CalculationPipelineExecutionContext executionContext, ILogger logger, IPolicyNumberGenerator policyNumberGenerator) : BasePipelineStep(logger)
+public class GeneratePolicyNumberStep(
+    CalculationPipelineExecutionContext executionContext,
+    ILogger logger,
+    IPolicyNumberGenerator policyNumberGenerator,
+    ICustomMetrics metrics) : BasePipelineStep(logger, metrics)
 {
     private readonly CalculationPipelineExecutionContext _executionContext = executionContext;
     private readonly ILogger _logger = logger;
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/MainProposalChoosingStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/MainProposalChoosingStep.cs
index d9ce9ff821af874e9f95cb864da46976421881cf..16934a4ab07d52ad940da155a60836e19ce9ab67 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/MainProposalChoosingStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/MainProposalChoosingStep.cs
@@ -5,12 +5,13 @@ using System.Threading.Tasks;
 using KaskoInsuranceFactory.Main.Application.Base.Pipeline;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
+using Metrics.Wrapper;
 using Serilog;
 
 namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.PipelineSteps;
 
 [ExcludeFromCodeCoverage]
-public class MainProposalChoosingStep(CalculationPipelineExecutionContext executionContext, ILogger logger) : BasePipelineStep(logger)
+public class MainProposalChoosingStep(CalculationPipelineExecutionContext executionContext, ILogger logger, ICustomMetrics metrics) : BasePipelineStep(logger, metrics)
 {
     private readonly CalculationPipelineExecutionContext _executionContext = executionContext;
     private readonly ILogger _logger = logger;
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ManualChecksStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ManualChecksStep.cs
index d1275824b25e82cdb5d5a0ab7ef9f55644768670..981853c95503f482fd0dd393000991fe86c3a68c 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ManualChecksStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ManualChecksStep.cs
@@ -5,12 +5,13 @@ using System.Threading.Tasks;
 using KaskoInsuranceFactory.Main.Application.Base.Pipeline;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
+using Metrics.Wrapper;
 using Serilog;
 
 namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.PipelineSteps;
 
 [ExcludeFromCodeCoverage]
-public class ManualChecksStep(CalculationPipelineExecutionContext executionContext, ILogger logger) : BasePipelineStep(logger)
+public class ManualChecksStep(CalculationPipelineExecutionContext executionContext, ILogger logger, ICustomMetrics metrics) : BasePipelineStep(logger, metrics)
 {
     private readonly CalculationPipelineExecutionContext _executionContext = executionContext;
     private readonly ILogger _logger = logger;
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/PreCalculationStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/PreCalculationStep.cs
index 6b6d3a01f12826422f35f04cc195673f3c4e9293..8da26a4b14e8812583278505fc6128db8ddc4bb0 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/PreCalculationStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/PreCalculationStep.cs
@@ -5,12 +5,13 @@ using System.Threading.Tasks;
 using KaskoInsuranceFactory.Main.Application.Base.Pipeline;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
+using Metrics.Wrapper;
 using Serilog;
 
 namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.PipelineSteps;
 
 [ExcludeFromCodeCoverage]
-public class PreCalculationStep(CalculationPipelineExecutionContext executionContext, ILogger logger) : BasePipelineStep(logger)
+public class PreCalculationStep(CalculationPipelineExecutionContext executionContext, ILogger logger, ICustomMetrics metrics) : BasePipelineStep(logger, metrics)
 {
     private readonly CalculationPipelineExecutionContext _executionContext = executionContext;
     private readonly ILogger _logger = logger;
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/SaveDataStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/SaveDataStep.cs
index 19a4511f163492ef208f08b0479c51bb07c3b056..9fc26b71fd899ad3b9b66190690b49ee7c96d2f7 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/SaveDataStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/SaveDataStep.cs
@@ -8,30 +8,25 @@ using KaskoInsuranceFactory.Main.Application.Constants.Logging;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
 using KaskoInsuranceFactory.Main.Application.Services;
+using Metrics.Wrapper;
 using Serilog;
 
 namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.PipelineSteps;
 
 [ExcludeFromCodeCoverage]
-public class SaveDataStep : BasePipelineStep
+public class SaveDataStep(
+    CalculationPipelineExecutionContext executionContext,
+    IMapper mapper,
+    IPolicyDraftService draftService,
+    ILogger logger,
+    ICustomMetrics metrics) : BasePipelineStep(logger, metrics)
 {
-    private readonly CalculationPipelineExecutionContext _executionContext;
-    private readonly IPolicyDraftService _draftService;
-    private readonly ILogger _logger;
+    private readonly CalculationPipelineExecutionContext _executionContext = executionContext;
+    private readonly IPolicyDraftService _draftService = draftService;
+    private readonly ILogger _logger = logger;
 
     protected override string LoggingKey => _executionContext.PolicyDraft.PolicyDraftKey;
 
-    public SaveDataStep(
-        CalculationPipelineExecutionContext executionContext,
-        IMapper mapper,
-        IPolicyDraftService draftService,
-        ILogger logger) : base(logger)
-    {
-        _executionContext = executionContext;
-        _draftService = draftService;
-        _logger = logger;
-    }
-
     public override async Task ExecuteInternalAsync(CancellationToken cancellationToken = default)
     {
         try
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ScoringStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ScoringStep.cs
index 9c825523514f181d45e367d2fb3a09af46c73708..6172dbacf5a81d62247e9e7c01c180c1a25d87f7 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ScoringStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ScoringStep.cs
@@ -5,12 +5,13 @@ using System.Threading.Tasks;
 using KaskoInsuranceFactory.Main.Application.Base.Pipeline;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
+using Metrics.Wrapper;
 using Serilog;
 
 namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.PipelineSteps;
 
 [ExcludeFromCodeCoverage]
-public class ScoringStep(CalculationPipelineExecutionContext executionContext, ILogger logger) : BasePipelineStep(logger)
+public class ScoringStep(CalculationPipelineExecutionContext executionContext, ILogger logger, ICustomMetrics metrics) : BasePipelineStep(logger, metrics)
 {
     private readonly CalculationPipelineExecutionContext _executionContext = executionContext;
     private readonly ILogger _logger = logger;
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/SegmentationStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/SegmentationStep.cs
index cc732d77b628dfa6903a46e24de77ec6c80d999a..7216a4289235085b8afcc41ba9547d02c17d55f9 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/SegmentationStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/SegmentationStep.cs
@@ -9,6 +9,7 @@ using KaskoInsuranceFactory.Main.Application.Base.Pipeline;
 using KaskoInsuranceFactory.Main.Application.Constants.Logging;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
+using Metrics.Wrapper;
 using Segmentation.Constants;
 using Segmentation.Interfaces;
 using Serilog;
@@ -16,22 +17,18 @@ using Serilog;
 namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.PipelineSteps;
 
 [ExcludeFromCodeCoverage]
-public class SegmentationStep : BasePipelineStep
+public class SegmentationStep(
+    CalculationPipelineExecutionContext executionContext,
+    ILogger logger,
+    ISegmentationService segmentationService,
+    ICustomMetrics metrics) : BasePipelineStep(logger, metrics)
 {
-    private CalculationPipelineExecutionContext _executionContext;
-    private readonly ILogger _logger;
-    private readonly ISegmentationService _segmentationService;
+    private CalculationPipelineExecutionContext _executionContext = executionContext;
+    private readonly ILogger _logger = logger;
+    private readonly ISegmentationService _segmentationService = segmentationService;
 
     protected override string LoggingKey => _executionContext.PolicyDraft.PolicyDraftKey;
 
-    public SegmentationStep(CalculationPipelineExecutionContext executionContext, ILogger logger, ISegmentationService segmentationService)
-        : base(logger)
-    {
-        _executionContext = executionContext;
-        _logger = logger;
-        _segmentationService = segmentationService;
-    }
-
     public override async Task ExecuteInternalAsync(CancellationToken cancellationToken = default)
     {
         try
diff --git a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ValidationStep.cs b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ValidationStep.cs
index 3597cb4d41756e3244a97581a57d544f11964b8a..9aea3d123095f1121c3ee7fac71db06dd60cb18d 100644
--- a/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ValidationStep.cs
+++ b/sources/App/src/Modules/Main/Application/Implementation/Processes/CalculationProcess/PipelineSteps/ValidationStep.cs
@@ -8,30 +8,25 @@ using KaskoInsuranceFactory.Main.Application.Constants.Logging;
 using KaskoInsuranceFactory.Main.Application.Extension.Logging;
 using KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.Pipeline;
 using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Calculation.Request;
+using Metrics.Wrapper;
 using Serilog;
 
 namespace KaskoInsuranceFactory.Main.Application.Implementation.Processes.CalculationProcess.PipelineSteps;
 
 [ExcludeFromCodeCoverage]
-public class ValidationStep : BasePipelineStep
+public class ValidationStep(
+    CalculationPipelineExecutionContext executionContext,
+    IValidator<CalculationRequest> validator,
+    ILogger logger,
+     ICustomMetrics metrics) : BasePipelineStep(logger, metrics)
 
 {
-    private readonly CalculationPipelineExecutionContext _executionContext;
-    private readonly IValidator<CalculationRequest> _validator;
-    private readonly ILogger _logger;
+    private readonly CalculationPipelineExecutionContext _executionContext = executionContext;
+    private readonly IValidator<CalculationRequest> _validator = validator;
+    private readonly ILogger _logger = logger;
 
     protected override string LoggingKey => _executionContext.PolicyDraft.PolicyDraftKey;
 
-    public ValidationStep(
-        CalculationPipelineExecutionContext executionContext,
-        IValidator<CalculationRequest> validator,
-        ILogger logger) : base(logger)
-    {
-        _executionContext = executionContext;
-        _validator = validator;
-        _logger = logger;
-    }
-
     public override async Task ExecuteInternalAsync(CancellationToken cancellationToken = default)
     {
         var request = _executionContext.Input;
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Calculation/Response/KaskoInsuranceModelResponseDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Calculation/Response/KaskoInsuranceModelResponseDto.cs
index f7f975c7c9b918b7d4519751a4ecea74f9e2548a..28f7ce7ee018fd6b916295198c96d4574a6735a6 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Calculation/Response/KaskoInsuranceModelResponseDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Calculation/Response/KaskoInsuranceModelResponseDto.cs
@@ -1,6 +1,4 @@
-using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Calculation.Response;
-
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Calculation.Response;
 
 public record KaskoInsuranceModelResponseDto : IResponseModel
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/CalculatedProposalDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/CalculatedProposalDto.cs
index b96256ed12dcbbdd59d68942923a3255c7d9b958..953202b6083fecba8a28f245c92d0486ffde8829 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/CalculatedProposalDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/CalculatedProposalDto.cs
@@ -1,4 +1,4 @@
-using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos;
 
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/BaseSpecialProductStructureResponsePartDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/BaseSpecialProductStructureResponsePartDto.cs
index 47011d794e54375a8c774feaf94352a5d808aca8..ee23d122f0e1d363351652dca4f787b00c1d0cc9 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/BaseSpecialProductStructureResponsePartDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/BaseSpecialProductStructureResponsePartDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public abstract class BaseSpecialProductStructureResponsePartDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/BaseSpecialProductStructureResponsePartExtendedDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/BaseSpecialProductStructureResponsePartExtendedDto.cs
index 8b5fd409d483a489db93f482b3ddbf523437b0df..00ec34f398bca593c47349d0f148549e583ec361 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/BaseSpecialProductStructureResponsePartExtendedDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/BaseSpecialProductStructureResponsePartExtendedDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public abstract class BaseSpecialProductStructureResponsePartExtendedDto : BaseSpecialProductStructureResponsePartDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/CompensationOptionResponseDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/CompensationOptionResponseDto.cs
index 1e382925fad2724ffba687b9b8c5307b4135ed16..eaaf5d58957a0549e080f1166c3ba432c167b945 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/CompensationOptionResponseDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/CompensationOptionResponseDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public class CompensationOptionResponseDto : BaseSpecialProductStructureResponsePartDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/ConditionBlockResponseDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/ConditionBlockResponseDto.cs
index d78873289c4b78b7159d133ed9a0be6c12d17681..912a25ee3a983c09d101c1bae8c48959a727fad8 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/ConditionBlockResponseDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/ConditionBlockResponseDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public class ConditionBlockResponseDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/ConditionGroupResponseDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/ConditionGroupResponseDto.cs
index 8d79025d065970532ec856be17eb6d2ce7b8a4fd..a4a3eea18216fff5eb90d172e80c13ac9f836cbe 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/ConditionGroupResponseDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/ConditionGroupResponseDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public class ConditionGroupResponseDto : BaseSpecialProductStructureResponsePartExtendedDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/CoverageResponseDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/CoverageResponseDto.cs
index 67ed77ebb3d650b7e2f37db984a5a6ac9b0f291e..d651617e9345cfcca85fe04a2a0eac20c1203f56 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/CoverageResponseDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/CoverageResponseDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public class CoverageResponseDto : BaseSpecialProductStructureResponsePartExtendedDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/DeltaDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/DeltaDto.cs
index 6e0271be08faf44116a2603bdf66344ddebdbcc9..14584a04304a4c8d7d72697f8693d115af0d0824 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/DeltaDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/DeltaDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public class DeltaDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/FranchiseResponseDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/FranchiseResponseDto.cs
index 7e7c6df37bb3a2418c266911bedf0fccc71847a9..f47834e2adecdd3a76c223ca6b24a346232cbef5 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/FranchiseResponseDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/FranchiseResponseDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public class FranchiseResponseDto : BaseSpecialProductStructureResponsePartDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/InsuranceObjectResponseDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/InsuranceObjectResponseDto.cs
index c7f8667e42d8fd1e547e4e907a3e6814567a35ea..0185da0773449e551de2dc1f1f5b514ac0d06617 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/InsuranceObjectResponseDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/InsuranceObjectResponseDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public class InsuranceObjectResponseDto : BaseSpecialProductStructureResponsePartExtendedDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/IntegrationCodeDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/IntegrationCodeDto.cs
index 7572478150eae42db22d7b7e89aa885d8bdd8050..362529c3f8a1d4db91743ac9ad0d07b770fb7cb0 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/IntegrationCodeDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/IntegrationCodeDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public class IntegrationCodeDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/OptionResponseDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/OptionResponseDto.cs
index 13fcf8f92dba635cfbdd64c6c97b67fde8e7b0e0..83abd0a2e112b92e6c6f66352edfe7d3b74d0519 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/OptionResponseDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/OptionResponseDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public class OptionResponseDto : BaseSpecialProductStructureResponsePartDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/PaymentScheduleResponseDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/PaymentScheduleResponseDto.cs
index 7a01bacec968039c805becadb39628eb2362e813..a87f1805787a038422c7e412bf89b01ce0e1e0aa 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/PaymentScheduleResponseDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/PaymentScheduleResponseDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public class PaymentScheduleResponseDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/RiskResponseDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/RiskResponseDto.cs
index f210cde89c4c8f1a7c7d446a6e87430fd14777f2..fe6d5e8f251f537bc7a6738b45d78e0db208b95f 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/RiskResponseDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/RiskResponseDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public class RiskResponseDto : BaseSpecialProductStructureResponsePartExtendedDto
 {
diff --git a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/SpecialProductStructureResponseDto.cs b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/SpecialProductStructureResponseDto.cs
index 8552ad3389ab571c09e844736859b22ea09b61a7..5fa5f9564e1fee4d20375add99160c75a8621315 100644
--- a/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/SpecialProductStructureResponseDto.cs
+++ b/sources/App/src/Modules/Main/DTO/ApiKaskoFactory/Dtos/SpecialProductStructure/Response/SpecialProductStructureResponseDto.cs
@@ -1,4 +1,4 @@
-namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure;
+namespace KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos.SpecialProductStructure.Response;
 
 public record SpecialProductStructureResponseDto
 {
diff --git a/sources/App/src/Modules/Main/Tests/Mapping/ContextToResponseMappingTests.cs b/sources/App/src/Modules/Main/Tests/Mapping/ContextToResponseMappingTests.cs
index 11645a90dd1058e705147aea1541fcf43ee6c1cd..473398dfda9bef97cfad269ead8c07aeb50fbaa2 100644
--- a/sources/App/src/Modules/Main/Tests/Mapping/ContextToResponseMappingTests.cs
+++ b/sources/App/src/Modules/Main/Tests/Mapping/ContextToResponseMappingTests.cs
@@ -7,10 +7,9 @@ using KaskoInsuranceFactory.Main.Application.Mapper;
 using KaskoInsuranceFactory.Main.Application.Models;
 using KaskoInsuranceFactory.Main.Domain.ManualEntities;
 using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Calculation.Response;
-using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos;
 using NUnit.Framework;
 
-namespace KaskoInsuranceFactory.Main.Tests;
+namespace KaskoInsuranceFactory.Main.Tests.Mapping;
 
 public class ContextToResponseMappingTests
 {
@@ -46,7 +45,7 @@ public class ContextToResponseMappingTests
 
         context.PolicyNumber = "POLICY_NUMBER";
         context.PolicyDraft.PolicyDraftKey = "POLICY_DRAFT_KEY";
-        context.Messages = new List<Error> { new Error {  Code = "000", Level = "Warning", Path = "PATH", Text = "TEXT"} };
+        context.Messages = new List<Error> { new Error { Code = "000", Level = "Warning", Path = "PATH", Text = "TEXT" } };
 
         var result = _mapper.Map<CalculationResponse<KaskoInsuranceModelResponseDto>>(context);
 
diff --git a/sources/App/src/Modules/Main/Tests/PipelineSteps/AutomaticChecksStepTests.cs b/sources/App/src/Modules/Main/Tests/PipelineSteps/AutomaticChecksStepTests.cs
index a5da23cf13fbd1f6cec96c0be936315fa1e999c3..da7597cafd2241b47265a76209f0556fbb857d92 100644
--- a/sources/App/src/Modules/Main/Tests/PipelineSteps/AutomaticChecksStepTests.cs
+++ b/sources/App/src/Modules/Main/Tests/PipelineSteps/AutomaticChecksStepTests.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics.Metrics;
 using System.Linq;
 using System.Threading.Tasks;
 using Domain.Entities;
@@ -10,6 +11,7 @@ using KaskoInsuranceFactory.Main.Application.Implementation.Processes.Calculatio
 using KaskoInsuranceFactory.Main.Domain.ManualEntities;
 using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Calculation.Request;
 using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos;
+using Metrics.Wrapper;
 using Moq;
 using NUnit.Framework;
 using Serilog;
@@ -20,16 +22,21 @@ public class AutomaticChecksStepTests
 {
     private Mock<IBlackListCheckService> _blackListCheckService;
     private Mock<ILogger> _loggerMock;
+    private Mock<ICustomMetrics> _metricsMock;
 
     [SetUp]
     public void Setup()
     {
         _blackListCheckService = new Mock<IBlackListCheckService>();
         _loggerMock = new Mock<ILogger>();
+        _metricsMock = new Mock<ICustomMetrics>();
 
         _loggerMock.Setup(x => x.ForContext(It.IsAny<Type>())).Returns(_loggerMock.Object);
         _loggerMock.Setup(x => x.ForContext(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<bool>())).Returns(_loggerMock.Object);
         _loggerMock.Setup(x => x.ForContext(It.IsAny<string>(), It.IsAny<object>(), It.IsAny<bool>())).Returns(_loggerMock.Object);
+        _metricsMock.Setup(x => x.CreateGauge(It.IsAny<string>(), It.IsAny<Func<IEnumerable<Measurement<long>>>>()));
+        _metricsMock.Setup(x => x.RecordCounter(It.IsAny<string>(), It.IsAny<long>()));
+        _metricsMock.Setup(x => x.RecordHistogram(It.IsAny<string>(), It.IsAny<long>()));
     }
 
     [Test]
@@ -109,7 +116,7 @@ public class AutomaticChecksStepTests
     }
 
     private AutomaticChecksStep CreateTarget(CalculationPipelineExecutionContext context) =>
-        new AutomaticChecksStep(context, _loggerMock.Object, _blackListCheckService.Object);
+        new AutomaticChecksStep(context, _loggerMock.Object, _metricsMock.Object, _blackListCheckService.Object);
 
     private CalculationPipelineExecutionContext CreateContext(bool checkScoringOnCalculate) =>
         new CalculationPipelineExecutionContext
diff --git a/sources/App/src/Modules/Main/Tests/PipelineSteps/ProlongationStepTests.cs b/sources/App/src/Modules/Main/Tests/PipelineSteps/ProlongationStepTests.cs
index 2cabe774c6cd950ce2dfcf9262d2cffe25ae4fe8..75cdb4b2d9cdde13ae8ac5535b0c9b24f4b191b7 100644
--- a/sources/App/src/Modules/Main/Tests/PipelineSteps/ProlongationStepTests.cs
+++ b/sources/App/src/Modules/Main/Tests/PipelineSteps/ProlongationStepTests.cs
@@ -1,4 +1,6 @@
 using System;
+using System.Collections.Generic;
+using System.Diagnostics.Metrics;
 using System.Threading;
 using System.Threading.Tasks;
 using Domain.Entities;
@@ -7,6 +9,7 @@ using KaskoInsuranceFactory.Main.Application.Implementation.Processes.Calculatio
 using KaskoInsuranceFactory.Main.Domain.ManualEntities;
 using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Calculation.Request;
 using KaskoInsuranceFactory.Main.DTO.ApiKaskoFactory.Dtos;
+using Metrics.Wrapper;
 using Moq;
 using NUnit.Framework;
 using SasClient.Dto;
@@ -24,6 +27,7 @@ public class ProlongationStepTests
     private CalculationPipelineExecutionContext _context;
     private CheckProlongationStep _target;
     private Mock<CheckProlongationStep> _targetMock;
+    private Mock<ICustomMetrics> _metricsMock;
 
     [SetUp]
     public void Setup()
@@ -32,10 +36,15 @@ public class ProlongationStepTests
         _prolongationServiceMock = new Mock<IProlongationService>();
         _loggerMock = new Mock<ILogger>();
         _context = new CalculationPipelineExecutionContext();
+        _metricsMock = new Mock<ICustomMetrics>();
 
         _loggerMock.Setup(x => x.ForContext(It.IsAny<Type>())).Returns(_loggerMock.Object);
         _loggerMock.Setup(x => x.ForContext(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<bool>())).Returns(_loggerMock.Object);
         _loggerMock.Setup(x => x.ForContext(It.IsAny<string>(), It.IsAny<object>(), It.IsAny<bool>())).Returns(_loggerMock.Object);
+
+        _metricsMock.Setup(x => x.CreateGauge(It.IsAny<string>(), It.IsAny<Func<IEnumerable<Measurement<long>>>>()));
+        _metricsMock.Setup(x => x.RecordCounter(It.IsAny<string>(), It.IsAny<long>()));
+        _metricsMock.Setup(x => x.RecordHistogram(It.IsAny<string>(), It.IsAny<long>()));
     }
 
     [Test]
@@ -49,7 +58,7 @@ public class ProlongationStepTests
             .ReturnsAsync(prolongationResponse);
 
         _targetMock = new Mock<CheckProlongationStep>(
-            () => new CheckProlongationStep(_context, _prolongationServiceMock.Object, _loggerMock.Object))
+            () => new CheckProlongationStep(_context, _prolongationServiceMock.Object, _loggerMock.Object, _metricsMock.Object))
         { CallBase = true };
 
         _target = _targetMock.Object;
@@ -71,7 +80,7 @@ public class ProlongationStepTests
             .ReturnsAsync(prolongationResponse);
 
         _targetMock = new Mock<CheckProlongationStep>(
-            () => new CheckProlongationStep(_context, _prolongationServiceMock.Object, _loggerMock.Object))
+            () => new CheckProlongationStep(_context, _prolongationServiceMock.Object, _loggerMock.Object, _metricsMock.Object))
         { CallBase = true };
 
         _target = _targetMock.Object;
@@ -93,7 +102,7 @@ public class ProlongationStepTests
             .ThrowsAsync(new Exception());
 
         _targetMock = new Mock<CheckProlongationStep>(
-            () => new CheckProlongationStep(_context, _prolongationServiceMock.Object, _loggerMock.Object))
+            () => new CheckProlongationStep(_context, _prolongationServiceMock.Object, _loggerMock.Object, _metricsMock.Object))
         { CallBase = true };
 
         _target = _targetMock.Object;
@@ -114,7 +123,7 @@ public class ProlongationStepTests
         _context = CreateContext(false);
 
         _targetMock = new Mock<CheckProlongationStep>(
-            () => new CheckProlongationStep(_context, _prolongationServiceMock.Object, _loggerMock.Object))
+            () => new CheckProlongationStep(_context, _prolongationServiceMock.Object, _loggerMock.Object, _metricsMock.Object))
         { CallBase = true };
 
         _target = _targetMock.Object;
diff --git a/sources/App/src/Modules/Metrics/App/HttpClient/HttpMetricsHandler.cs b/sources/App/src/Modules/Metrics/App/HttpClient/HttpMetricsHandler.cs
new file mode 100644
index 0000000000000000000000000000000000000000..875e62bacb1346e1840a3faef9d7b410ce8f1929
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/HttpClient/HttpMetricsHandler.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Net;
+using System.Diagnostics;
+using Serilog;
+using System.Net.Http.Headers;
+using System.Threading.Tasks;
+using System.Net.Http;
+using System.Threading;
+using Metrics;
+using Metrics.Wrapper;
+
+namespace Metrics.HttpClient;
+
+public class HttpMetricsHandler : DelegatingHandler, IDisposable
+{
+    private readonly ILogger _logger;
+    private readonly string _serviceName;
+    private readonly ICustomMetrics _metrics;
+    private readonly ActivitySource _activitySource;
+
+    public HttpMetricsHandler(ILogger logger, string serviceName, ICustomMetrics metrics)
+    {
+        if (string.IsNullOrWhiteSpace(serviceName))
+        {
+            throw new ArgumentException($"'{nameof(serviceName)}' cannot be null or whitespace.", nameof(serviceName));
+        }
+
+        _serviceName = serviceName;
+        _metrics = metrics;
+        _activitySource = StaticActivityProvider.ActivitySource;
+        //безусловно добавляем слушателя, чтобы метрики работали независимо от внешних слушаетелей
+        StaticActivityProvider.AddDummyListener();
+    }
+
+    protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
+    {
+        ArgumentNullException.ThrowIfNull(request);
+
+        using var activity = _activitySource.StartActivity($"Вызов {_serviceName}", ActivityKind.Client);
+        ArgumentNullException.ThrowIfNull(activity);
+
+        HttpResponseMessage response;
+        try
+        {
+            var stopwatch = Stopwatch.StartNew();
+            response = await base.SendAsync(request, cancellationToken);
+            stopwatch.Stop();
+            await RecordRequestMetricsAsync(request, response, stopwatch);
+        }
+        catch (Exception ex)
+        {
+            _logger.Error(ex, $"Исключение при обращении к {{{"SourceContext"}}}", _serviceName);
+            throw;
+        }
+
+        activity.Stop();
+        return response;
+    }
+
+    private async Task RecordRequestMetricsAsync(HttpRequestMessage request, HttpResponseMessage response, Stopwatch watch)
+    {
+        _metrics.RecordHistogram(MetricLabels.DependencyTotalTimeBackets(_serviceName), watch.ElapsedMilliseconds);
+    }
+}
diff --git a/sources/App/src/Modules/Metrics/App/HttpClient/HttpMetricsHandlerAutofacRegistration.cs b/sources/App/src/Modules/Metrics/App/HttpClient/HttpMetricsHandlerAutofacRegistration.cs
new file mode 100644
index 0000000000000000000000000000000000000000..8915afc75fa2601efa60d7ea2e7fb56f36471cae
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/HttpClient/HttpMetricsHandlerAutofacRegistration.cs
@@ -0,0 +1,41 @@
+using Autofac;
+using Autofac.Extensions.DependencyInjection;
+using iRIS.Framework.Common;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Http;
+using Microsoft.Extensions.Options;
+using System;
+
+namespace Metrics.HttpClient;
+
+public static class HttpMetricsHandlerAutofacRegistration
+{
+    public static void AddHttpClientMetrics(this ContainerBuilder builder, IConfiguration configuration,
+        string httpClientName, string logTitle)
+    {
+        var serviceCollection = new ServiceCollection();
+        builder.Populate(serviceCollection);
+        builder.RegisterType<HttpMetricsHandler>();
+        builder.RegisterType<HttpMetricsHandlerFactory>();
+        builder.Register<IConfigureOptions<HttpClientFactoryOptions>>(context =>
+        new ConfigureNamedOptions<HttpClientFactoryOptions>(httpClientName, options =>
+        {
+            options.HttpMessageHandlerBuilderActions.Add(b =>
+            {
+                var factory = b.Services.GetRequiredService<HttpMetricsHandlerFactory>();
+                b.AdditionalHandlers.Add(factory.Get(httpClientName, logTitle));
+            });
+        }));
+    }
+
+    public static void AddHttpClientMetrics<T>(this ContainerBuilder builder, IConfiguration configuration)
+    {
+        builder.AddHttpClientMetrics(configuration, typeof(T).Name, typeof(T).Name);
+    }
+
+    public static void AddHttpClientMetrics(this ContainerBuilder builder, IConfiguration configuration, string httpClientName)
+    {
+        builder.AddHttpClientMetrics(configuration, httpClientName, httpClientName);
+    }
+}
diff --git a/sources/App/src/Modules/Metrics/App/HttpClient/HttpMetricsHandlerFactory.cs b/sources/App/src/Modules/Metrics/App/HttpClient/HttpMetricsHandlerFactory.cs
new file mode 100644
index 0000000000000000000000000000000000000000..744dd8925af23e4fc01819f8485f0079230f9864
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/HttpClient/HttpMetricsHandlerFactory.cs
@@ -0,0 +1,20 @@
+using Microsoft.Extensions.Options;
+using System;
+
+namespace Metrics.HttpClient;
+
+internal class HttpMetricsHandlerFactory
+{
+    private readonly Func<string, HttpMetricsHandler> _httpClientLoggingHandlerFunc;
+
+    public HttpMetricsHandlerFactory(
+        Func<string, HttpMetricsHandler> httpClientLoggingHandlerFunc)
+    {
+        _httpClientLoggingHandlerFunc = httpClientLoggingHandlerFunc;
+    }
+
+    public HttpMetricsHandler Get(string serviceName, string logTitle)
+    {
+        return _httpClientLoggingHandlerFunc(logTitle);
+    }
+}
diff --git a/sources/App/src/Modules/Metrics/App/Metrics.csproj b/sources/App/src/Modules/Metrics/App/Metrics.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..da025b4a9fc7c50792ae3365932a0d2507aa3b53
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/Metrics.csproj
@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="iRIS.Framework.Hosting.Core" />
+    <PackageReference Include="iRIS.Framework.Common" />
+    <PackageReference Include="iRIS.Framework.CrossCutting" />
+  </ItemGroup>
+  
+</Project>
diff --git a/sources/App/src/Modules/Metrics/App/StaticActivityProvider.cs b/sources/App/src/Modules/Metrics/App/StaticActivityProvider.cs
new file mode 100644
index 0000000000000000000000000000000000000000..de11ae31df8cb5519fb840f38e934de0e1146f58
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/StaticActivityProvider.cs
@@ -0,0 +1,29 @@
+using System.Diagnostics;
+
+namespace Metrics;
+
+public static class StaticActivityProvider
+{
+    public static readonly string ActivitySourceName = "HttpLoggingActivitySource";
+
+    public static ActivitySource ActivitySource { get; } = new ActivitySource(ActivitySourceName, "1.0.0");
+
+    private static ActivityListener _dummyListener;
+
+    /// <summary>
+    /// Если на ActivitySource никто не подписан, то он отдает null.
+    /// dummyListener служит для обхода этой проблемы
+    /// </summary>
+    internal static void AddDummyListener()
+    {
+        if (_dummyListener == null)
+        {
+            _dummyListener = new ActivityListener()
+            {
+                ShouldListenTo = source => source.Name == ActivitySourceName,
+                Sample = (ref ActivityCreationOptions<ActivityContext> _) => ActivitySamplingResult.AllData
+            };
+        }
+        ActivitySource.AddActivityListener(_dummyListener);
+    }
+}
diff --git a/sources/App/src/Modules/Metrics/App/Wcf/ClientMetricsMessageInspector.cs b/sources/App/src/Modules/Metrics/App/Wcf/ClientMetricsMessageInspector.cs
new file mode 100644
index 0000000000000000000000000000000000000000..27344317ee1dbb341dba6e4958e4d30da1a898da
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/Wcf/ClientMetricsMessageInspector.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Diagnostics;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Dispatcher;
+using System.Web;
+using System.Xml.Linq;
+using Metrics;
+using Metrics.Wrapper;
+using OpenTelemetry.Metrics;
+using Serilog;
+
+namespace Metrics.Wcf;
+
+public class ClientMetricsMessageInspector : IClientMessageInspector
+{
+    private readonly ActivitySource _activitySource;
+    private readonly string _serviceName;
+    private readonly ICustomMetrics _metrics;
+    private Stopwatch _stopwatch;
+
+    public ClientMetricsMessageInspector(string serviceName, ILogger logger, ICustomMetrics metrics)
+    {
+        _serviceName = serviceName;
+        _metrics = metrics;
+        _activitySource = StaticActivityProvider.ActivitySource;
+        _stopwatch = new Stopwatch();
+        //безусловно добавляем слушателя, чтобы логи работали независимо от внешних слушаетелей
+        StaticActivityProvider.AddDummyListener();
+    }
+
+    public object BeforeSendRequest(ref Message request, IClientChannel channel)
+    {
+        var activity = _activitySource.StartActivity($"Запрос к {_serviceName}", ActivityKind.Client);
+        ArgumentNullException.ThrowIfNull(activity);
+        _stopwatch.Reset();
+        _stopwatch.Start();
+        return activity;
+    }
+
+    public virtual void AfterReceiveReply(ref Message reply, object correlationState)
+    {
+        if (correlationState is Activity activity)
+        {
+            activity.Stop();
+            activity.Dispose();
+        }
+        _stopwatch.Stop();
+        RecordMetric(reply, _stopwatch);
+    }
+
+    private void RecordMetric(Message reply, Stopwatch watch)
+    {
+        _metrics.RecordHistogram(MetricLabels.DependencyTotalTimeBackets(_serviceName), watch.ElapsedMilliseconds);
+    }
+}
diff --git a/sources/App/src/Modules/Metrics/App/Wcf/MetricsRecordingBehavior.cs b/sources/App/src/Modules/Metrics/App/Wcf/MetricsRecordingBehavior.cs
new file mode 100644
index 0000000000000000000000000000000000000000..bdf4a3aeabd9ffe5615602d14309066d6b44a19f
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/Wcf/MetricsRecordingBehavior.cs
@@ -0,0 +1,39 @@
+using System;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+
+namespace Metrics.Wcf;
+public class MetricsRecordingBehavior : IEndpointBehavior
+{
+    private readonly ClientMetricsMessageInspector _inspector;
+
+    public MetricsRecordingBehavior(ClientMetricsMessageInspector inspector)
+    {
+        _inspector = inspector;
+    }
+
+    public void AddBindingParameters(
+        ServiceEndpoint endpoint,
+        BindingParameterCollection bindingParameters)
+    {
+    }
+
+    public void ApplyClientBehavior(
+        ServiceEndpoint endpoint,
+        ClientRuntime clientRuntime)
+    {
+        clientRuntime.ClientMessageInspectors.Add(_inspector);
+    }
+
+    public void ApplyDispatchBehavior(
+        ServiceEndpoint endpoint,
+        EndpointDispatcher endpointDispatcher)
+    {
+        throw new NotSupportedException("Behavior not supported on the server side!");
+    }
+
+    public void Validate(ServiceEndpoint endpoint)
+    {
+    }
+}
diff --git a/sources/App/src/Modules/Metrics/App/Wcf/WcfMetricsHandlerAutofacRegistration.cs b/sources/App/src/Modules/Metrics/App/Wcf/WcfMetricsHandlerAutofacRegistration.cs
new file mode 100644
index 0000000000000000000000000000000000000000..185f8ac57384c4088ee5d5c82d7ccd696e6316d6
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/Wcf/WcfMetricsHandlerAutofacRegistration.cs
@@ -0,0 +1,27 @@
+using Autofac;
+using Autofac.Extensions.DependencyInjection;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using System;
+
+namespace Metrics.Wcf;
+public static class WcfMetricsHandlerAutofacRegistration
+{
+    public static void AddWcfMetrics<TClient>(this ContainerBuilder builder, IConfiguration configuration, string logTitle)
+    {
+        var serviceName = typeof(TClient).Name;
+        var serviceCollection = new ServiceCollection();
+        builder.Populate(serviceCollection);
+
+        builder.RegisterType<ClientMetricsMessageInspector>();
+        builder.RegisterType<WcfMetricsRecordingBehaviorFactory>();
+        builder.RegisterType<MetricsRecordingBehavior>();
+        builder.Register(c => c.Resolve<WcfMetricsRecordingBehaviorFactory>().Get(serviceName, logTitle))
+            .Named<MetricsRecordingBehavior>(serviceName);
+    }
+
+    public static MetricsRecordingBehavior GetMetricsRecordingBehaviour<TClient>(this IComponentContext context)
+    {
+        return context.ResolveNamed<MetricsRecordingBehavior>(typeof(TClient).Name);
+    }
+}
diff --git a/sources/App/src/Modules/Metrics/App/Wcf/WcfMetricsRecordingBehaviorFactory.cs b/sources/App/src/Modules/Metrics/App/Wcf/WcfMetricsRecordingBehaviorFactory.cs
new file mode 100644
index 0000000000000000000000000000000000000000..4fc19b250b08ee7e280902d73837d7c41abc2946
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/Wcf/WcfMetricsRecordingBehaviorFactory.cs
@@ -0,0 +1,25 @@
+using Microsoft.Extensions.Options;
+using System;
+
+namespace Metrics.Wcf;
+
+/// <summary>
+/// Фабрика для создания LoggingBehavior
+/// Упрощает регистрацию за счет того, что не надо указывать параметры, которые DI контейнер может подставить самостоятельно.
+/// </summary>
+internal class WcfMetricsRecordingBehaviorFactory
+{
+    private readonly Func<string, ClientMetricsMessageInspector> _clientLoggingMessageInspectorFunc;
+    private readonly Func<ClientMetricsMessageInspector, MetricsRecordingBehavior> _loggingBehaviorFunc;
+
+    public WcfMetricsRecordingBehaviorFactory(Func<string, ClientMetricsMessageInspector> clientLoggingMessageInspectorFunc, Func<ClientMetricsMessageInspector, MetricsRecordingBehavior> loggingBehaviorFunc)
+    {
+        _clientLoggingMessageInspectorFunc = clientLoggingMessageInspectorFunc;
+        _loggingBehaviorFunc = loggingBehaviorFunc;
+    }
+
+    public MetricsRecordingBehavior Get(string serviceName, string logTitle)
+    {
+        return _loggingBehaviorFunc(_clientLoggingMessageInspectorFunc(logTitle));
+    }
+}
diff --git a/sources/App/src/Modules/Metrics/App/Wrapper/CustomMetrics.cs b/sources/App/src/Modules/Metrics/App/Wrapper/CustomMetrics.cs
new file mode 100644
index 0000000000000000000000000000000000000000..6c6f48567dba61d9e051721e1521290a13dc0522
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/Wrapper/CustomMetrics.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.Metrics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http.Extensions;
+
+namespace Metrics.Wrapper;
+public class CustomMetrics : ICustomMetrics
+{
+    private readonly Meter _meter;
+    private readonly IDictionary<string, Histogram<long>> _histograms;
+    private readonly IDictionary<string, Counter<long>> _counters;
+    private readonly IDictionary<string, ObservableGauge<long>> _gauges;
+    private readonly IHttpContextAccessor _contextAccessor;
+
+    public CustomMetrics(IMeterFactory meterFactory, IHttpContextAccessor contextAccessor)
+    {
+        _contextAccessor = contextAccessor;
+
+        _histograms = new Dictionary<string, Histogram<long>>();
+        _counters = new Dictionary<string, Counter<long>>();
+        _gauges = new Dictionary<string, ObservableGauge<long>>();
+
+        _meter = meterFactory.Create("KaskoInsuranceFactory.Main");
+    }
+
+    public void RecordCounter(string name, long value)
+    {
+        Counter<long> counter;
+        if (!_counters.TryGetValue(name, out counter))
+        {
+            counter = _meter.CreateCounter<long>(name, null, null, new List<KeyValuePair<string, object>>()
+            {
+                new KeyValuePair<string, object>("fullUrl", _contextAccessor.HttpContext.Request.GetEncodedUrl()),
+                new KeyValuePair<string, object>("fullPath", _contextAccessor.HttpContext.Request.GetEncodedPathAndQuery())
+            });
+            _counters.Add(name, counter);
+        }
+        counter.Add(value);
+    }
+
+    public void CreateGauge(string name, Func<IEnumerable<Measurement<long>>> func)
+    {
+        ObservableGauge<long> counter;
+        if (!_gauges.TryGetValue(name, out counter))
+        {
+            counter = _meter.CreateObservableGauge(name, func);
+            _gauges.Add(name, counter);
+        }
+    }
+
+    public void RecordHistogram(string name, long value)
+    {
+        Histogram<long> counter;
+        if (!_histograms.TryGetValue(name, out counter))
+        {
+            counter = _meter.CreateHistogram<long>(name, null, null, new List<KeyValuePair<string, object>>()
+            {
+                new KeyValuePair<string, object>("fullUrl", _contextAccessor.HttpContext.Request.GetEncodedUrl()),
+                new KeyValuePair<string, object>("fullPath", _contextAccessor.HttpContext.Request.GetEncodedPathAndQuery())
+            });
+            _histograms.Add(name, counter);
+        }
+        counter.Record(value);
+    }
+}
diff --git a/sources/App/src/Modules/Metrics/App/Wrapper/ICustomMetrics.cs b/sources/App/src/Modules/Metrics/App/Wrapper/ICustomMetrics.cs
new file mode 100644
index 0000000000000000000000000000000000000000..84f0bb55721f7c0f9f08c70e9fc1243effbdf178
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/Wrapper/ICustomMetrics.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.Metrics;
+
+namespace Metrics.Wrapper;
+
+public interface ICustomMetrics
+{
+    void RecordHistogram(string name, long value);
+
+    void RecordCounter(string name, long value);
+
+    void CreateGauge(string name, Func<IEnumerable<Measurement<long>>> value);
+}
diff --git a/sources/App/src/Modules/Metrics/App/Wrapper/MetricLabels.cs b/sources/App/src/Modules/Metrics/App/Wrapper/MetricLabels.cs
new file mode 100644
index 0000000000000000000000000000000000000000..95e837694d777f17a806dc299ab7ea983dbc41cc
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/App/Wrapper/MetricLabels.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Metrics.Wrapper;
+public static class MetricLabels
+{
+    public static string SuccessfullCalculation = "custom_logic_successfull_calculations";
+    public static string RequestTotalTimeBackets = "custom_request_TotalTimeBackets";
+    public static string StepTotalTimeBackets(string stepName) => $"custom_step_TotalTimeBackets_{stepName}";
+    public static string DependencyTotalTimeBackets(string serviceName) => $"custom_dependency_TotalTimeBackets_{serviceName}";
+}
diff --git a/sources/App/src/Modules/Metrics/Tests/Tests/CustomMetricsTests.cs b/sources/App/src/Modules/Metrics/Tests/Tests/CustomMetricsTests.cs
new file mode 100644
index 0000000000000000000000000000000000000000..a0ac8a1b4e0c48d54c470112fad9dc5a3e178777
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/Tests/Tests/CustomMetricsTests.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http.Extensions;
+using Moq;
+using NUnit.Framework;
+using System.Diagnostics.Metrics;
+using Metrics.Wrapper;
+using System.Net.Http;
+using System.Xml.Linq;
+
+namespace Tests
+{
+    [TestFixture]
+    public class CustomMetricsTests
+    {
+        private Mock<IMeterFactory> _meterFactoryMock;
+        private Mock<IHttpContextAccessor> _httpContextAccessorMock;
+        private Mock<Meter> _meterMock;
+        private CustomMetrics _customMetrics;
+
+        [SetUp]
+        public void SetUp()
+        {
+            _meterFactoryMock = new Mock<IMeterFactory>();
+            _httpContextAccessorMock = new Mock<IHttpContextAccessor>();
+            _meterMock = new Mock<Meter>("Test");
+            _meterFactoryMock.Setup(mf => mf.Create(It.IsAny<MeterOptions>())).Returns(_meterMock.Object);
+
+            var httpContextMock = new Mock<HttpContext>();
+            var requestMock = new Mock<HttpRequest>();
+            requestMock.Setup(req => req.Scheme).Returns("http");
+            requestMock.Setup(req => req.Host).Returns(new HostString("test.com"));
+            requestMock.Setup(req => req.Path).Returns("/test");
+            requestMock.Setup(req => req.QueryString).Returns(new QueryString("?param=value"));
+
+            httpContextMock.Setup(ctx => ctx.Request).Returns(requestMock.Object);
+            _httpContextAccessorMock.Setup(h => h.HttpContext).Returns(httpContextMock.Object);
+
+            _customMetrics = new CustomMetrics(_meterFactoryMock.Object, _httpContextAccessorMock.Object);
+        }
+
+        [Test]
+        public void RecordCounter_ShouldCreateAndRecordCounter_WhenCalled()
+        {
+            // Act
+            _customMetrics.RecordCounter("test.counter", 1);
+
+            // Assert
+            _meterMock.Verify(meter => meter.CreateCounter<long>(
+                "test.counter", null, null, It.IsAny<List<KeyValuePair<string, object>>>()), Times.Once);
+        }
+
+        [Test]
+        public void CreateGauge_ShouldCreateGauge_WhenCalled()
+        {
+            // Arrange
+            Func<IEnumerable<Measurement<long>>> func = () => new List<Measurement<long>>
+            {
+                new Measurement<long>(5)
+            };
+
+            // Act
+            _customMetrics.CreateGauge("test.gauge", func);
+
+            // Assert
+            _meterMock.Verify(meter => meter.CreateObservableGauge("test.gauge", func, It.IsAny<string>(), It.IsAny<string>()), Times.Once);
+        }
+
+        [Test]
+        public void RecordHistogram_ShouldCreateAndRecordHistogram_WhenCalled()
+        {
+            // Act
+            _customMetrics.RecordHistogram("test.histogram", 10);
+
+            // Assert
+            _meterMock.Verify(meter => meter.CreateHistogram<long>(
+                "test.histogram", null, null, It.IsAny<List<KeyValuePair<string, object>>>()), Times.Once);
+        }
+    }
+}
diff --git a/sources/App/src/Modules/Metrics/Tests/Tests/Tests.csproj b/sources/App/src/Modules/Metrics/Tests/Tests/Tests.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..a7b5cf33e4680754994ae6080c11f91c02ed5e14
--- /dev/null
+++ b/sources/App/src/Modules/Metrics/Tests/Tests/Tests.csproj
@@ -0,0 +1,30 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <IsPackable>false</IsPackable>
+    <IsTestProject>true</IsTestProject>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" />
+    <PackageReference Include="Moq" />
+    <PackageReference Include="NUnit" />
+    <PackageReference Include="NUnit3TestAdapter" />
+    <PackageReference Include="coverlet.collector" />
+    <PackageReference Include="MockQueryable.Moq" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="iRIS.Framework.Hosting.Core" />
+    <PackageReference Include="iRIS.Framework.Common" />
+    <PackageReference Include="iRIS.Framework.CrossCutting" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\..\App\Metrics.csproj" />
+  </ItemGroup>
+
+</Project>


Необходимо добавить метрику в Викторию "Неуспешные калькуляции"
По метрике необходимо будет считать общее количество неуспешных калькуляций

Как мне добавить новую метрику в графане?