Skip to content

Commit

Permalink
fix: Add validator name to notify
Browse files Browse the repository at this point in the history
  • Loading branch information
wirwolf committed Apr 22, 2020
1 parent 4bceb49 commit d0bc356
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CI_COMMIT_REF_SLUG=master
APP_DEBUG=true
APP_ENV=development
APP_VERSION=0.0.0
APP_VALIDATOR_NAME=undefined

APP_SENTRY_ENABLED=false
APP_SENTRY_DSN=************
Expand Down
1 change: 1 addition & 0 deletions app/src/Config/app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class ConfigFactory {
public static getBase(): AppInfo {
return {
id: env('APP_NAME', 'app'),
validatorName: env('APP_VALIDATOR_NAME', 'undefined'),
version: env('APP_VERSION'),
environment: env('APP_ENV'),
};
Expand Down
1 change: 1 addition & 0 deletions app/src/Core/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export class Core {

export interface AppInfo {
id: string;
validatorName: string;
version: string;
environment: string;
}
Expand Down
1 change: 1 addition & 0 deletions app/src/Modules/Notify/Modules/Telegram/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class NotifyToTelegram extends BaseModule<NotifyToTelegram> {
*/
private generateMessage(eventName:string, level: string, description): string {
let text = '';
text = text + '*' + Core.getAppInfo().validatorName + '*\n\r';
text = text + 'Instance id: ' + Core.getAppInfo().id + '\n\r';
text = text + 'Environment: ' + Core.getAppInfo().environment + '\n\r';
text = text + 'App version: ' + Core.getAppInfo().version + '\n\r';
Expand Down
1 change: 1 addition & 0 deletions docs/guide-ru/env-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
| APP_NAME | string | app | Уникальный идентификатор инстанса приложения. Исполльзуется в нотификации и для отлавливания ошибок |
| APP_DEBUG | bool | false | |
| APP_ENV | string | | Название окружения, в котором запускается система |
| APP_VALIDATOR_NAME | string | undefined | Имя валидатора - для отображения в сообщениях |
| APP_SENTRY_ENABLED | bool | false | Флаг для включения системы мониторинга ошибок [Sentry](https://sentry.io) |
| APP_SENTRY_DSN | string | https://[email protected]/123 | Токен для отправки ошибок в Sentry ([подробности](https://docs.sentry.io/error-reporting/quickstart/?platform=node#configure-the-sdk)) |
| REDIS_HOST | string | redis | Имя хоста для подключения к redis |
Expand Down

0 comments on commit d0bc356

Please sign in to comment.