Skip to content

Commit 33cbd36

Browse files
authored
Merge pull request #231 from hirosystems/fix/env-prometheus-port
fix: use prometheus port configured in ENV
2 parents 0fafe1c + c769d29 commit 33cbd36

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
env:
5454
API_HOST: 127.0.0.1
5555
API_PORT: 3000
56+
PROMETHEUS_PORT: 9154
5657
PGHOST: 127.0.0.1
5758
PGPORT: 5432
5859
PGUSER: postgres

src/env.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const schema = Type.Object({
2121
ADMIN_RPC_HOST: Type.String({ default: '0.0.0.0' }),
2222
/** Port in which to serve the Admin RPC interface */
2323
ADMIN_RPC_PORT: Type.Number({ default: 3001, minimum: 0, maximum: 65535 }),
24+
/** Port in which to serve prometheus metrics */
25+
PROMETHEUS_PORT: Type.Number({ default: 9154 }),
2426

2527
PGHOST: Type.String(),
2628
PGPORT: Type.Number({ default: 5432, minimum: 0, maximum: 65535 }),

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async function initApiService(db: PgStore) {
105105
});
106106

107107
TokenProcessorMetrics.configure(db);
108-
await promServer.listen({ host: ENV.API_HOST, port: 9153 });
108+
await promServer.listen({ host: ENV.API_HOST, port: ENV.PROMETHEUS_PORT });
109109
}
110110
}
111111

0 commit comments

Comments
 (0)