Skip to content

Commit

Permalink
Merge pull request #1003 from pokt-foundation/develop
Browse files Browse the repository at this point in the history
[staging] feat: add method to log
  • Loading branch information
rem1niscence authored Nov 30, 2022
2 parents de576ce + 367800d commit 5d11b1a
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 52 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- 'develop'
- 'feat/arm-support'
tags:
- 'v*'
pull_request:
Expand Down Expand Up @@ -46,6 +47,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions .github/workflows/production-eu-central-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Terraform Production Deployment eu-central-1

on:
push:
branches: [master, eth-altruist]
branches: [master]

jobs:
deploy:
Expand Down Expand Up @@ -122,4 +122,4 @@ jobs:
task-definition: ${{ steps.task-def-eu-central-1-datadog-agent.outputs.task-definition }}
service: gateway-prod
cluster: gateway-prod
wait-for-service-stability: true
wait-for-service-stability: true
1 change: 1 addition & 0 deletions .github/workflows/tag_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- develop
- develop-k8s
- master

jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Terraform Production Deployment eu-central-1

on:
push:
branches: [master, eth-altruist]
branches: [master]

jobs:
deploy:
Expand Down
14 changes: 14 additions & 0 deletions scripts/error.init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TABLE error (
timestamp TIMESTAMPTZ NOT NULL,
applicationpublickey TEXT NOT NULL,
blockchain TEXT NOT NULL,
nodepublickey TEXT,
elapsedtime DOUBLE PRECISION NOT NULL,
bytes NUMERIC NOT NULL,
method TEXT,
message TEXT,
code TEXT
);
CREATE INDEX error_node_public_key_timestamp_idx ON error(nodepublickey, timestamp DESC);
CREATE INDEX error_timestamp_application_public_key_idx ON error(timestamp DESC, applicationpublickey);
CREATE INDEX error_timestamp_idx ON error(timestamp DESC);
11 changes: 1 addition & 10 deletions src/services/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,14 @@ const consoleFormat = printf(

const startTime = new Date().toISOString()

const logFormat = format.combine(
format.colorize(),
format.simple(),
format.timestamp({
format: 'YYYY-MM-DD HH:mm:ss.SSS',
}),
consoleFormat
)

const logName = (process.env.REGION_NAME || '') + '/ecs/gateway'

const options = {
console: {
level: 'debug',
handleExceptions: true,
colorize: true,
format: logFormat,
format: format.json(),
silent,
},
aws: {
Expand Down
3 changes: 3 additions & 0 deletions src/services/metrics-recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class MetricsRecorder {
relayType: 'APP',
typeID: applicationID,
gigastakeAppID,
method,
serviceNode,
serviceURL,
serviceDomain,
Expand All @@ -142,6 +143,7 @@ export class MetricsRecorder {
relayType: 'APP',
typeID: applicationID,
gigastakeAppID,
method,
serviceNode,
serviceURL,
serviceDomain,
Expand All @@ -162,6 +164,7 @@ export class MetricsRecorder {
relayType: 'APP',
typeID: applicationID,
gigastakeAppID,
method,
serviceNode,
serviceURL,
serviceDomain,
Expand Down
34 changes: 0 additions & 34 deletions stacks/local.init.sql

This file was deleted.

10 changes: 5 additions & 5 deletions stacks/local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
depends_on:
- db
- cache
- metricsdb
- errorsdb
networks:
- pocket

Expand Down Expand Up @@ -57,9 +57,9 @@ services:
- pocket

# DB to store errors
metricsdb:
container_name: metricsdb
image: timescale/timescaledb:2.0.2-pg12
errorsdb:
image: postgres:15.1
container_name: errorsdb
environment:
- POSTGRES_USER=pguser
- POSTGRES_PASSWORD=pgpassword
Expand All @@ -69,7 +69,7 @@ services:
networks:
- pocket
volumes:
- ./local.init.sql:/docker-entrypoint-initdb.d/init.sql
- ../scripts/error.init.sql:/docker-entrypoint-initdb.d/init.sql

influxdb:
image: quay.io/influxdb/influxdb:v2.0.3
Expand Down

0 comments on commit 5d11b1a

Please sign in to comment.