{"id":18608795,"url":"https://github.com/recruitee/plug_collect","last_synced_at":"2025-11-02T18:30:33.811Z","repository":{"id":42574150,"uuid":"472809565","full_name":"Recruitee/plug_collect","owner":"Recruitee","description":"Instrumentation library to intercept and collect Plug requests.","archived":false,"fork":false,"pushed_at":"2023-01-04T14:54:54.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-01-27T07:16:01.765Z","etag":null,"topics":["elixir","phoenix","phoenix-framework","plug"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Recruitee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-22T14:40:40.000Z","updated_at":"2022-07-18T13:32:16.000Z","dependencies_parsed_at":"2023-02-02T17:03:28.152Z","dependency_job_id":null,"html_url":"https://github.com/Recruitee/plug_collect","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recruitee%2Fplug_collect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recruitee%2Fplug_collect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recruitee%2Fplug_collect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Recruitee%2Fplug_collect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Recruitee","download_url":"https://codeload.github.com/Recruitee/plug_collect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239399814,"owners_count":19632022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","phoenix","phoenix-framework","plug"],"created_at":"2024-11-07T03:04:20.757Z","updated_at":"2025-11-02T18:30:33.547Z","avatar_url":"https://github.com/Recruitee.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PlugCollect\n\n[![Hex Version](https://img.shields.io/hexpm/v/plug_collect)](https://hex.pm/packages/plug_collect)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen)](https://hexdocs.pm/plug_collect)\n[![CI](https://github.com/Recruitee/plug_collect/workflows/CI/badge.svg)](https://github.com/Recruitee/plug_collect/actions/workflows/ci.yml)\n\nBasic instrumentation library to intercept and collect Plug pipeline connection parameters for\nfurther reporting, monitoring or analysis with user provided function.\n\nPlugCollect is inspired by other libraries:\n* [Appsignal.Plug](https://github.com/appsignal/appsignal-elixir-plug),\n* [Sentry.PlugCapture](https://github.com/getsentry/sentry-elixir).\n\n## Installation\nAdd `plug_collect` to your application dependencies list in `mix.exs`:\n```elixir\n#mix.exs\ndef deps do\n  [\n    {:plug_collect, \"~\u003e 0.2.0\"}\n  ]\nend\n```\n\n## Usage\nAdd `use PlugCollect` to your application's Phoenix endpoint or router, for example:\n```elixir\n#endpoint.ex\ndefmodule MyAppWeb.Endpoint do\n  use PlugCollect, collectors: [\u0026MyApp.Monitor.my_collect/2]\n  use Phoenix.Endpoint, otp_app: :my_app\n  # ...\n```\n\nCallback function `MyApp.Monitor.my_collect/2` will be invoked on each request.\nExample `my_collect/2` callback implementation:\n```elixir\ndefmodule MyApp.Monitor do\n  def my_collect(_status, %Plug.Conn{assigns: assigns} = _conn),\n    do: Logger.metadata(user_id: Map.get(assigns, :user_id))\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecruitee%2Fplug_collect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frecruitee%2Fplug_collect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecruitee%2Fplug_collect/lists"}