medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
469 stars 217 forks source link

feat(#8216): propagate api request id to haproxy #9613

Closed dianabarsan closed 2 weeks ago

dianabarsan commented 2 weeks ago

Description

Adds custom header to pass the id of the original client request from API to all cascading requests to CouchDb. Changes request ID to being a 12 char long string (uuid slice) instead of the whole uuid.

8216

Code review checklist

Compose URLs

If Build CI hasn't passed, these may 404:

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

dianabarsan commented 2 weeks ago

Since you've already been here, @garethbowen , mind a proper review? Thanks!

garethbowen commented 2 weeks ago

It would also be worth checking that whatever we land on here works with 3rd party tools to pull logs from multiple services, eg: https://grafana.com/docs/grafana/latest/explore/simplified-exploration/logs/ (released like a month ago!)

dianabarsan commented 2 weeks ago

It would also be worth checking that whatever we land on here works with 3rd party tools to pull logs from multiple services, eg: https://grafana.com/docs/grafana/latest/explore/simplified-exploration/logs/ (released like a month ago!)

I think we already have a custom logging structure, we don't follow some specific standard.

garethbowen commented 2 weeks ago

I think we already have a custom logging structure, we don't follow some specific standard.

I agree. IMO the killer feature is for our observability server to be able to show all things that happened across all services for a specific request. I'm assuming this change will make that work, but if you felt like testing loki to make sure that'd be valuable. It should work with custom logging structures.