Skip to content

Commit

Permalink
BC-8373 - move @infra/metrics folder to @apps/helpers/metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
bergatco committed Jan 15, 2025
1 parent 3fb085e commit be3a372
Show file tree
Hide file tree
Showing 18 changed files with 13 additions and 15 deletions.
3 changes: 1 addition & 2 deletions apps/server/src/apps/fwu-learning-contents.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { install as sourceMapInstall } from 'source-map-support';
// application imports
import { FwuLearningContentsModule } from '@modules/fwu-learning-contents/fwu-learning-contents.app.module';
import { LegacyLogger } from '@src/core/logger';
import { enableOpenApiDocs } from './helpers';
import { createRequestLoggerMiddleware } from './helpers/request-logger-middleware';
import { createRequestLoggerMiddleware, enableOpenApiDocs } from './helpers';

async function bootstrap() {

Check warning on line 15 in apps/server/src/apps/fwu-learning-contents.app.ts

View workflow job for this annotation

GitHub Actions / nest_lint

Missing return type on function
sourceMapInstall();
Expand Down
3 changes: 1 addition & 2 deletions apps/server/src/apps/h5p-editor.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { install as sourceMapInstall } from 'source-map-support';
// application imports
import { H5PEditorModule } from '@modules/h5p-editor/h5p-editor.app.module';
import { LegacyLogger } from '@src/core/logger';
import { enableOpenApiDocs } from './helpers';
import { createRequestLoggerMiddleware } from './helpers/request-logger-middleware';
import { createRequestLoggerMiddleware, enableOpenApiDocs } from './helpers';

async function bootstrap() {

Check warning on line 15 in apps/server/src/apps/h5p-editor.app.ts

View workflow job for this annotation

GitHub Actions / nest_lint

Missing return type on function
sourceMapInstall();
Expand Down
3 changes: 2 additions & 1 deletion apps/server/src/apps/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './app-start-loggable';
export * from './prometheus-metrics';
export * from './metrics';
export * from './request-logger-middleware';
export * from './swagger';
1 change: 1 addition & 0 deletions apps/server/src/apps/helpers/metrics/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './prometheus-metrics';
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { createMock } from '@golevelup/ts-jest';
import { Configuration } from '@hpi-schul-cloud/commons';
import { IConfig } from '@hpi-schul-cloud/commons/lib/interfaces/IConfig';
import { Logger } from '@src/core/logger';
import express, { Express, NextFunction, Request, RequestHandler, Response } from 'express';
import {
PrometheusMetricsConfig,
createAPIResponseTimeMetricMiddleware,
createPrometheusMetricsApp,
} from '@infra/metrics';
import { Logger } from '@src/core/logger';
import express, { Express, NextFunction, Request, RequestHandler, Response } from 'express';
} from './prometheus';
import {
PrometheusMetricsSetupState,
PrometheusMetricsSetupStateLoggable,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Express } from 'express';

import { LogMessage, Loggable, Logger } from '@src/core/logger';
import { AppStartLoggable } from '../app-start-loggable';
import {
PrometheusMetricsConfig,
createAPIResponseTimeMetricMiddleware,
createPrometheusMetricsApp,
} from '@infra/metrics';
import { LogMessage, Loggable, Logger } from '@src/core/logger';
import { AppStartLoggable } from './app-start-loggable';
} from './prometheus';

export const enum PrometheusMetricsSetupState {
FEATURE_DISABLED_MIDDLEWARES_WILL_NOT_BE_CREATED = 'Prometheus metrics feature is disabled - no metrics middlewares will be added to the app',
Expand Down
3 changes: 1 addition & 2 deletions apps/server/src/apps/management.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { MikroORM } from '@mikro-orm/core';
import { ManagementServerModule } from '@modules/management/management-server.app.module';
import { LegacyLogger } from '@src/core/logger';
import { install as sourceMapInstall } from 'source-map-support';
import { enableOpenApiDocs } from './helpers';
import { createRequestLoggerMiddleware } from './helpers/request-logger-middleware';
import { createRequestLoggerMiddleware, enableOpenApiDocs } from './helpers';
import legacyAppPromise = require('../../../../src/app');

async function bootstrap(): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/apps/server.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import {
addPrometheusMetricsMiddlewaresIfEnabled,
AppStartLoggable,
createAndStartPrometheusMetricsAppIfEnabled,
createRequestLoggerMiddleware,
enableOpenApiDocs,
} from './helpers';
import { createRequestLoggerMiddleware } from './helpers/request-logger-middleware';
import legacyAppPromise = require('../../../../src/app');

async function bootstrap() {
Expand Down
1 change: 0 additions & 1 deletion apps/server/src/infra/metrics/index.ts

This file was deleted.

0 comments on commit be3a372

Please sign in to comment.