Skip to content

Commit

Permalink
chore: add metrics to tasks api
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-shirbandi committed Oct 22, 2023
1 parent 0ffb811 commit 7724b8b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using TaskoMask.BuildingBlocks.Web.Grpc.Configuration;
using Microsoft.Extensions.Configuration;

namespace TaskoMask.Services.Tasks.Read.Api.Configuration
{
Expand Down Expand Up @@ -37,12 +38,12 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
/// <summary>
///
/// </summary>
public static WebApplication ConfigurePipeline(this WebApplication app)
public static WebApplication ConfigurePipeline(this WebApplication app, IConfiguration configuration)
{

app.UseSerilogRequestLogging();

app.UseWebApiPreConfigured(app.Environment);
app.UseWebApiPreConfigured(app.Environment, configuration);

app.Services.InitialDatabase();

Expand Down
2 changes: 1 addition & 1 deletion src/2-Services/Tasks/Api/Tasks.Read.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

var builder = WebApplication.CreateBuilder(args);

var app = builder.ConfigureServices().ConfigurePipeline();
var app = builder.ConfigureServices().ConfigurePipeline(builder.Configuration);

app.Run();
8 changes: 8 additions & 0 deletions src/2-Services/Tasks/Api/Tasks.Read.Api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
"CacheTimeInMinutes": 60,
"Enabled": true
},
"Metric": {
"StandAloneKestrelServerEnabled": true,
"Port": 8081,
"Url": "/metrics",
"Hostname": "+",
"HttpMetricsEnabled": true,
"SuppressDefaultMetrics": false
},
"Jwt": {
"Authority": "https://identity.taskomask.ir",
"Audience": "tasks.api",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using TaskoMask.Services.Tasks.Write.Api.Infrastructure.CrossCutting.DI;
using TaskoMask.Services.Tasks.Write.Api.Infrastructure.Data.DbContext;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;

namespace TaskoMask.Services.Tasks.Write.Api.Configuration
{
Expand All @@ -30,12 +31,12 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
/// <summary>
///
/// </summary>
public static WebApplication ConfigurePipeline(this WebApplication app)
public static WebApplication ConfigurePipeline(this WebApplication app, IConfiguration configuration)
{

app.UseSerilogRequestLogging();

app.UseWebApiPreConfigured(app.Environment);
app.UseWebApiPreConfigured(app.Environment, configuration);

app.Services.InitialDatabasesAndSeedEssentialData();

Expand Down
2 changes: 1 addition & 1 deletion src/2-Services/Tasks/Api/Tasks.Write.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

var builder = WebApplication.CreateBuilder(args);

var app = builder.ConfigureServices().ConfigurePipeline();
var app = builder.ConfigureServices().ConfigurePipeline(builder.Configuration);

app.Run();
8 changes: 8 additions & 0 deletions src/2-Services/Tasks/Api/Tasks.Write.Api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
"Password": "Password",
"KeyNamespace": "TaskoMaskEventStore"
},
"Metric": {
"StandAloneKestrelServerEnabled": true,
"Port": 8081,
"Url": "/metrics",
"Hostname": "+",
"HttpMetricsEnabled": true,
"SuppressDefaultMetrics": false
},
"Jwt": {
"Authority": "https://identity.taskomask.ir",
"Audience": "tasks.api",
Expand Down

0 comments on commit 7724b8b

Please sign in to comment.