Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix startup failure #321

Merged
merged 3 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions changelog.d/144.changelog

This file was deleted.

1 change: 1 addition & 0 deletions changelog.d/321.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix crash on startup due to logging / metrics failures.
1 change: 0 additions & 1 deletion src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export class Config {

public readonly logging: IConfigLogging = {
console: "info",
files: undefined,
};

public readonly profile: IConfigProfile = {
Expand Down
4 changes: 1 addition & 3 deletions src/Metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ interface IBridgeGauges {

export class Metrics {
public static init(bridge: Bridge) {
this.metrics = new PrometheusMetrics();
this.metrics.registerMatrixSdkMetrics();
this.metrics = bridge.getPrometheusMetrics();
this.metrics.registerBridgeGauges(() => this.bridgeGauges);
this.metrics.addAppServicePath(bridge);
this.remoteCallCounter = this.metrics.addCounter({
name: "remote_api_calls",
help: "Count of the number of remote API calls made",
Expand Down
2 changes: 1 addition & 1 deletion src/Program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { AutoRegistration } from "./AutoRegistration";
import { GatewayHandler } from "./GatewayHandler";
import request from "axios";

Logger.configure({console: "debug"});
const log = new Logger("Program");
const bridgeLog = new Logger("bridge");

Expand Down Expand Up @@ -72,7 +73,6 @@ class Program {
}

public start() {
Logger.configure({console: "debug"});

try {
this.cli.run();
Expand Down