Expand description
What a service logs about each request: a span with its method, path, request id, and whose it is (the campaign, once its token is checked, and the account, as the proxy says), in plain text or JSON lines, and as traces to an OpenTelemetry collector if there is one. Never a body, and never the query string, which may hold what someone typed.
Constants§
- ACCOUNT
- The account a request is for, set by the hosting’s proxy (from the
address it came to). Believed only with
TRUST_PROXY. - REQUEST_
ID - The request’s id: the proxy’s, or one of the service’s own. Answered in the response too, so a user’s report can be found in the logs.
Functions§
- flush
- Sends the traces not sent yet, before the service stops.
- requests
- Logs
router’s requests. Withtrust_proxy, the proxy’s request id and account are believed; without, a client’s are dropped. - subscriber
- The subscriber
init_logginginstalls, writing towriter: JSON lines whenjson, otherwise text for people; and withtraces, sending each span on as a trace too. - traces
- Sends spans as traces, as
service, to the OpenTelemetry collector atOTEL_EXPORTER_OTLP_ENDPOINT(such ashttp://collector:4318), over HTTP;Nonewithout one.