Commit Graph

33 Commits

Author SHA1 Message Date
Iain Sproat d36e2036aa fix(server): database connection pool timeouts reduced (#2646)
* fix(server): database connection pool timeouts reduced
- previous acquisition timeout was 60s; this is reduced to 16s for faster responsiveness
- this allows for 3x attempts of 5s each to create a connection, plus idle time between attempts

* Apply to other knex instances
2024-08-26 09:47:27 +01:00
Iain Sproat e55a94028d fix(metrics): include num pending validations in knex metrics (#2444) 2024-06-27 14:05:02 +01:00
Iain Sproat d851cecc02 feat(metrics): calculate remaining capacity in pg connection pool (#2443)
* feat(metrics): calculate remaining capacity in pg connection pool

* Apply metric to all relevant services
2024-06-26 21:23:56 +01:00
Kristaps Fabians Geikins 2f8272b6ae feat(shared): modularized package & node16 support (#2336)
* feat(shared): modularized package & node16 support

* lockfile update

* various fixes

* moar fixes

* added znv and zod as devdeps of shared

* lockfile update
2024-06-11 14:12:13 +03:00
Iain Sproat 357dd5fe0b Log webhook messages as warning (#1821) 2023-10-17 16:20:43 +01:00
Iain Sproat 6403a3fddd fix(webhook): should not duplicate logging of error (#1413)
- the caller should be responsible for logging an error response
2023-02-23 20:29:44 +00:00
Iain Sproat af98e9bfd9 fix(webhook): do not log problems connecting to external webhook environment as error severity (#1397)
* fix(webhook): do not log problems connecting to external webhook environment as error severity
- these are user controlled variables and do not necessarily indicate problems with our system
2023-02-21 09:37:24 +00:00
Gergő Jedlicska 77a908f55c feat(webhooks): remove double json stringifying of the webhook payload (#1294) 2023-01-10 14:31:54 +01:00
Iain Sproat 96bed71022 fix(logging): Improves error logging and pretty-prints logs during dev & test (#1255)
* Improves error logging
- use pino error logger correctly by passing in error as first argument

* monitor deployment: Filter logging at INFO level and above
* Use structured logging to create parameters for monitoring results
* Add structured logging to obj fileimport service
* Fileimport service, fix and improve logging
    - use child logger with additional context where possible
    - select appropriate logging level
- fix duplicated context in log statement
* REST endpoints, add context to structured logging and remove same context from message
* Webhook service provides context to bound logger to properly use structured logging
    - Pass bound logger containing context to `makeNetworkRequest`
    - do not log url, as it may contain a secret (like Discord's webhook urls), instead log the webhook Id
     - log error message when network call fails
* upload: make better use of structured logging when recording data
* pino-pretty when in dev or test mode
    - pino-pretty configured to send to stderr
* LOG_PRETTY env var
* Silence structured logging during testing
     - can not rely on determining the port number by reading from stdout/stderr
     - instead we determine which port is free, then create our server on that port
     - we then poll that port until the server is ready before commencing tests
* Allow puppeteer to install chromium
* Do not need to install chromium separately
2022-12-13 09:18:28 +00:00
Iain Sproat 4d01e13a84 feat(structured logging) (#1242)
* Revert "Revert structured logging 2 (#1240)"
This reverts commit 78ecaeffcb.
* Logging should not be bundled into core shared directory
* making sure observability stuff isnt bundled into frontend


Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2022-12-06 11:51:18 +00:00
Iain Sproat 78ecaeffcb Revert structured logging 2 (#1240)
* Revert "'@' shortcut must come after it is configured in bootstrap (#1239)"

This reverts commit 967329473f.

* Revert "Structured logging (attempt 2) (#1234)"

This reverts commit 444d2ca7dd.
2022-12-05 15:46:09 +00:00
Iain Sproat 444d2ca7dd Structured logging (attempt 2) (#1234)
* Revert "Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)"

This reverts commit 63e6581162.

* Use pino-http instead of express pino logger
* Use correct reference to knex and do not instantiate HttpLogger prematurely
* Adds missing dependency for pino to webhook-service
* Do not instantiate middleware when passed to express
* Refactor to move logging into shared
* Copy shared packages into dockerfiles
* Build shared workspace in docker build-stage for fileimport & webhook
2022-12-05 14:49:52 +00:00
Iain Sproat 63e6581162 Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)
This reverts commit 84cb74e8b3.
2022-11-25 16:57:28 +00:00
Iain Sproat 84cb74e8b3 feat(structured logging): implements structured logging for backend (#1217)
* each log line is a json object
* structured logging allows logs to be ingested by machines and the logs to be indexed and queried addresses #1105
* structured logging allows arbitrary properties to be appended to each log line, and ingestion of logs to remain robust
* Structured logging provided by `pino` library
* Add `express-pino-logger` dependency
* Remove `debug`, `morgan`, and `morgan-debug` and replace with structured logging
* `console.log` & `console.error` replaced with structured logging in backend
* Remove `DEBUG` environment variable and replace with `LOG_LEVEL`
- Note that there is a test which reads from a logged line on `stdout`. This is not robust, it would be better to use the childProcess.pid to look up the port number.
* Log errors at points we explicitly send error to Sentry
* Amend indentation of a couple of log messages to align indentation with others
2022-11-25 16:05:05 +00:00
Gergő Jedlicska aafa5cb759 fix(backend services'): remove query timeout setting, it causes streaming queries to crash (#813) 2022-06-21 14:05:52 +02:00
Gergő Jedlicska d817e6dd0a gergo/pgTimeout (#805)
* feat(server): add server authz pipeline rework first sketch

* feat(server authz): add new server authz middleware poc implementation

* test(server authz): add unittests for the new server authz workflow

* feat(wip rework of fileuploads vs blob storage): add basim impl of separate blob storage service

* feat(fileimport service): refactored file import service to utilize the new asssetstorage service

* refactor(server errors): refactor server errors to use the shared module definitions

Now all the errors inherit from BaseError

* refactor(fileimport service): cleanup after refactor

* feat(frontend fileimports): use the new blob storage for downloading the original file

* refactor(server fileimports): clean up the remnants of S3 storage from file imports

* refactor(server authz): centralize generic authz pipeline configs

* refactor(server blob storage): refactor / rename everything to use the `blob-storage` name

* ci(circleci): add s3 objectstorage environment variables

* ci(circleci): fix missing env variables

* ci(circleci): add minio test container

* ci(circleci): fix minio app startup

* ci(circleci): enable circleci remote docker

* ci(circleci): fix minio startup

* ci(cirleci): detach and wait properly for minio to start

* ci(circleci): revert to additional minio img config, it only fails when the container is stopped ?!

* ci(circleci): disable file uploads

* fix(fileimports): update with blob storage refactor leftovers

* feat(server blob storage): add blob storage graphql api

* refactor(server errors): merge new errors to shared module

* fix(server comments rte): fix import for RTE error

* chore(fileimports): remove node-fetch from dependency

* chore(server): remove body parser dependency

* fix(server blob storage): fix gql api

* fix(frontend): fix fileupload item not loading the new upload status, cause of premature event fire

* feat(server blob storage): fix file size limit and allow for public streams

* Update packages/server/modules/blobstorage/graph/schemas/blobstorage.graphql

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>

* chore(blobstorage): fix PR review issues

* fix(server): fix import bugs

* chore(docker): ignore python venv data for docker build context

* feat(knex): update knex configuration with min max connections and application_name

* feat(helm chart): configure postgres max connections for server in the helm chart

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2022-06-17 08:38:34 +02:00
Gergő Jedlicska 50f1e5f97e Merge pull request #743 from urbansurgery/fix/issue-742
Additional HTTP response codes acceptable.
2022-05-13 20:02:59 +02:00
Jonathon Broughton b79be15dfd refactor (prettier): passes prettier check 2022-05-05 10:37:54 +01:00
Jonathon Broughton e37b560ab5 Additional HTTP response codes acceptable.
Fixes issue #742 (https://github.com/specklesystems/speckle-server/issues/742#issue-1226421536)
2022-05-05 10:26:51 +01:00
cristi8 0a0fe3cb77 monitoring microservices; new container for overall monitoring of a deployment; helm update; helm local testing 2022-05-05 02:01:00 +03:00
luz paz 915cb0afaf Fix various typos
Found via `codespell -q 3 -S CHANGELOG.md -L doesnt,optio,promisses,tread,usera`
2022-04-15 13:49:46 -04:00
Fabians 1c7436e7ff extra prefer-const & object-shorthand 2022-04-04 19:00:24 +03:00
Gergő Jedlicska 66a6b0fdcc style(webhook-service): fix eslint errors on webhooks 2022-03-29 21:36:06 +02:00
Gergő Jedlicska 569b4688fa style(all): reformat with print width 88 2022-03-29 19:46:49 +02:00
Fabians aa5e94d640 chore: reformatting everything with prettier 2022-03-29 17:12:31 +03:00
Kristaps Fabians Geikins 8010bf3c4c feat: Standardized & cleaned up formatting & linting across repo #617 (#618)
* feat: Standardized & cleaned up formatting & linting across repo

Co-authored-by: Kristaps Fabians Geikins <fabians@speckle.systems>
Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2022-03-16 10:10:30 +02:00
Cristian Balas 9329265708 Upgrade dependencies (#577) 2022-02-07 14:04:26 +02:00
Cristian Balas 7cfa85a627 other lgtm fixes (#571) 2022-02-02 15:30:25 +02:00
Cristian Balas 019b7ac495 Service health (#516)
* health checks, sigterm handling for all services
2022-01-12 15:18:32 +02:00
Cristian Balas ae9beb8d69 Fix webhook service local-url handling (#507) 2021-12-20 12:38:34 +02:00
Cristian Balas ecf908c4c3 webhook limiting (#492) 2021-12-06 14:43:57 +02:00
cristi8 157db23f45 Added server info and user info to webhook payload 2021-07-21 20:45:57 +03:00
cristi8 ddc86eb157 Webhooks - microservice + hooks into activityStreams 2021-07-12 11:32:54 +03:00