add trace header

This commit is contained in:
steve-chavez
2023-05-11 01:37:50 -03:00
committed by Steve Chavez
parent 0bd43663fc
commit cb7d70c197
3 changed files with 46 additions and 0 deletions
+28
View File
@@ -89,6 +89,34 @@ When debugging a problem it's important to verify the PostgREST version. Look fo
Server: postgrest/11.0.1
.. _trace_header:
Trace Header
------------
You can enable tracing HTTP requests by setting :ref:`server-trace-header`. Specify the set header in the request, and the server will include it in the response.
.. code:: bash
server-trace-header = "X-Request-Id"
.. tabs::
.. code-tab:: http
GET /users
X-Request-Id: 123
.. code-tab:: bash Curl
curl "http://localhost:3000/users" \
-H "X-Request-Id: 123"
.. code::
HTTP/1.1 200 OK
X-Request-Id: 123
.. _explain_plan:
Execution plan
+13
View File
@@ -174,6 +174,7 @@ openapi-server-proxy-uri String Y
raw-media-types String Y
server-host String !4
server-port Int 3000
server-trace-header String Y
server-unix-socket String
server-unix-socket-mode String 660
=========================== ======= ================= ==========
@@ -670,6 +671,18 @@ server-port
The TCP port to bind the web server.
.. _server-trace-header:
server-trace-header
-------------------
=============== =================
**Environment** PGRST_SERVER_TRACE_HEADER
**In-Database** `pgrst.server_trace_header`
=============== =================
The header name used to trace HTTP requests. See :ref:`trace_header`.
.. _server-unix-socket:
server-unix-socket
+5
View File
@@ -9,6 +9,11 @@ Horizontal Filtering
- New ``isdistinct`` :ref:`operator <operators>`. It is a direct translation of `IS DINTINCT FROM <https://www.postgresql.org/docs/current/functions-comparison.html#FUNCTIONS-COMPARISON-PRED-TABLE>`_.
Admin
~~~~~
- New :ref:`trace_header`.
Documentation improvements
~~~~~~~~~~~~~~~~~~~~~~~~~~