OpenTelemetry tracing so we can see spans where the app is taking time.
For the user, we specifically show the spans for the external API HTTP requests
that are slow (so we know when the Matrix API is being slow).
Enable tracing:
- `npm run start -- --tracing`
- `npm run start-dev -- --tracing`
What does this PR change:
- Adds OpenTelemetry tracing with some of the automatic instrumentation (includes HTTP and express)
- We ignore traces for serving static assets (just noise)
- Adds `X-Trace-Id` to the response headers
- Adds `window.tracingSpansForRequest` which includes the external HTTP API requests made during the request
- Adds a fancy 504 timeout page that includes trace details and lists the slow HTTP requests
- Adds `jaegerTracesEndpoint` configuration to export tracing spans to Jaeger
- Related to, https://github.com/matrix-org/matrix-public-archive/issues/26
1. Build test homeserver Docker images which can federate with each other
2. Run end-to-end (e2e) tests
#### Dev notes
Sharing variables across jobs when the `services` field can't access the `env` context, https://github.community/t/how-to-use-env-with-container-image/17252/24
```yaml
env:
FOO: bar
jobs:
set_env:
outputs:
var: ${{ steps.save_var.outputs.var }}
steps:
- id: save_var
run: echo "::set-output name=var::${{ env.FOO }}"
actual_job:
needs: set_env
container:
image: ...whatever_you_need_here...${{ needs.set_env.outputs.var }}
```
Remove `matrix-bot-sdk` usage in tests because it didn't have timestamp massaging `?ts` and it's not really necessary to rely on since we can just call the API directly 🤷. `matrix-bot-sdk` is also very annoying having to build rust crypto packages.
We're now using direct `fetch` requests against the Matrix API and lightweight `client` object.
All 3 current tests pass ✅
Get this project running again after a few months of changes
from `hydrogen-view-sdk` and now finally after
https://github.com/vector-im/hydrogen-web/pull/693
merged to make the SDK friendly to locally link and develop on.