{"id":13508410,"url":"https://github.com/deadtrickster/prometheus-ecto","last_synced_at":"2025-04-05T06:05:52.063Z","repository":{"id":52552185,"uuid":"65932051","full_name":"deadtrickster/prometheus-ecto","owner":"deadtrickster","description":"Prometheus.io collector for Elixir.Ecto","archived":false,"fork":false,"pushed_at":"2021-04-26T10:34:35.000Z","size":58,"stargazers_count":78,"open_issues_count":9,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T16:36:47.127Z","etag":null,"topics":["collector","ecto","elixir","instrumenter","monitoring","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deadtrickster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-17T18:26:30.000Z","updated_at":"2025-03-11T14:36:46.000Z","dependencies_parsed_at":"2022-08-28T23:32:24.980Z","dependency_job_id":null,"html_url":"https://github.com/deadtrickster/prometheus-ecto","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadtrickster%2Fprometheus-ecto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadtrickster%2Fprometheus-ecto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadtrickster%2Fprometheus-ecto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadtrickster%2Fprometheus-ecto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deadtrickster","download_url":"https://codeload.github.com/deadtrickster/prometheus-ecto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294538,"owners_count":20915340,"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":["collector","ecto","elixir","instrumenter","monitoring","prometheus"],"created_at":"2024-08-01T02:00:52.664Z","updated_at":"2025-04-05T06:05:52.045Z","avatar_url":"https://github.com/deadtrickster.png","language":"Elixir","funding_links":[],"categories":["Instrumenting / Monitoring"],"sub_categories":[],"readme":"# Prometheus.io Ecto Instrumenter\n\n[![Build Status](https://travis-ci.org/deadtrickster/prometheus-ecto.svg?branch=master)](https://travis-ci.org/deadtrickster/prometheus-ecto)\n[![Module version](https://img.shields.io/hexpm/v/prometheus_ecto.svg?maxAge=2592000?style=plastic)](https://hex.pm/packages/prometheus_ecto)\n[![Documentation](https://img.shields.io/badge/hex-docs-green.svg)](https://hexdocs.pm/prometheus_ecto/)\n[![Total Download](https://img.shields.io/hexpm/dt/prometheus_ecto.svg?maxAge=2592000)](https://hex.pm/packages/prometheus_ecto)\n[![License](https://img.shields.io/hexpm/l/prometheus_ecto.svg?maxAge=259200)](https://github.com/deadtrickster/prometheus-ecto/blob/master/LICENSE)\n[![Last Updated](https://img.shields.io/github/last-commit/deadtrickster/prometheus-ecto.svg)](https://github.com/deadtrickster/prometheus-ecto/commits/master)\n\nEcto integration for [Prometheus.ex](https://github.com/deadtrickster/prometheus.ex)\n\n - IRC: #elixir-lang on Freenode;\n - [Slack](https://elixir-slackin.herokuapp.com/): #prometheus channel - [Browser](https://elixir-lang.slack.com/messages/prometheus) or App(slack://elixir-lang.slack.com/messages/prometheus).\n\n## Quickstart\n\n1. Define your instrumenter:\n\n    ```elixir\n    defmodule MyApp.Repo.Instrumenter do\n      use Prometheus.EctoInstrumenter\n    end\n    ```\n\n2. Call `MyApp.Repo.Instrumenter.setup/0` when application starts (e.g. supervisor setup):\n\n    ```elixir\n    MyApp.Repo.Instrumenter.setup()\n    ```\n\n3. If using Ecto 2, add `MyApp.Repo.Instrumenter` to Repo loggers list:\n\n    ```elixir\n    config :myapp, MyApp.Repo,\n      loggers: [MyApp.Repo.Instrumenter, Ecto.LogEntry]\n      # ...\n    ```\n\n    If using Ecto 3, attach to telemetry in your application start function:\n\n    ```elixir\n    :ok =\n      Telemetry.attach(\n        \"prometheus-ecto\",\n        [:my_app, :repo, :query],\n        MyApp.Repo.Instrumenter,\n        :handle_event,\n        %{}\n      )\n    ```\n\n    If using Ecto 3.1 with telemetry 0.4+:\n\n    ```elixir\n    :ok =\n      :telemetry.attach(\n        \"prometheus-ecto\",\n        [:my_app, :repo, :query],\n        \u0026MyApp.Repo.Instrumenter.handle_event/4,\n        %{}\n      )\n    ```\n\n## Integrations / Collectors / Instrumenters\n - [Ecto collector](https://github.com/deadtrickster/prometheus-ecto)\n - [Plugs Instrumenter/Exporter](https://github.com/deadtrickster/prometheus-plugs)\n - [Elli middleware](https://github.com/elli-lib/elli_prometheus)\n - [Fuse plugin](https://github.com/jlouis/fuse#fuse_stats_prometheus)\n - [Phoenix instrumenter](https://github.com/deadtrickster/prometheus-phoenix)\n - [Process Info Collector](https://github.com/deadtrickster/prometheus_process_collector.erl)\n - [RabbitMQ Exporter](https://github.com/deadtrickster/prometheus_rabbitmq_exporter)\n\n## Installation\n\n[Available in Hex](https://hex.pm/docs/publish), the package can be installed as:\n\n  1. Add `:prometheus_ecto` to your list of dependencies in `mix.exs`:\n\n      ```elixir\n      def deps do\n        [{:prometheus_ecto, \"~\u003e 1.4.3\"}]\n      end\n      ```\n\n  2. Ensure `:prometheus_ecto` is started before your application:\n\n      ```elixir\n      def application do\n        [applications: [:prometheus_ecto]]\n      end\n      ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadtrickster%2Fprometheus-ecto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeadtrickster%2Fprometheus-ecto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadtrickster%2Fprometheus-ecto/lists"}