# `Electric.Plug.LabelProcessPlug`
[🔗](https://github.com/electric-sql/electric/tree/%40core/sync-service%401.6.0/packages/sync-service/lib/electric/plug/label_process_plug.ex#L1)

A plug that assists debugging by labelling processes that handle requests with
details about the request.

The plug should be placed right after the match plug in the router:

  plug :match
  plug Electric.Plug.LabelProcessPlug

# `call`

# `init`

# `process_label`

Returns a description of the HTTP request to be used as the label for the request process.

## Examples

    iex> process_label(%{
    ...>   method: "GET",
    ...>   request_path: "/v1/shape",
    ...>   query_string: "table=users&offset=-1",
    ...>   assigns: %{plug_request_id: "F-jPUudNHxbD8lIAABQG"}
    ...> })
    "Request F-jPUudNHxbD8lIAABQG - GET /v1/shape?table=users&offset=-1"

    iex> process_label(%{
    ...>   method: "GET",
    ...>   request_path: "/v1/shape",
    ...>   query_string: "table=users",
    ...>   assigns: %{plug_request_id: "F-jPUudNHxbD8lIAABQG"}
    ...> })
    "Request F-jPUudNHxbD8lIAABQG - GET /v1/shape?table=users"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
