{"id":18465161,"url":"https://github.com/fishjam-dev/membrane_rtc_engine_timescaledb","last_synced_at":"2026-05-31T02:31:36.785Z","repository":{"id":42478260,"uuid":"510341137","full_name":"fishjam-dev/membrane_rtc_engine_timescaledb","owner":"fishjam-dev","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-07T08:52:07.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-03-22T13:05:44.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/fishjam-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-04T11:59:20.000Z","updated_at":"2023-01-04T22:09:33.000Z","dependencies_parsed_at":"2024-05-16T09:49:26.534Z","dependency_job_id":"fca6016b-5be1-492c-a71d-41c168034d22","html_url":"https://github.com/fishjam-dev/membrane_rtc_engine_timescaledb","commit_stats":null,"previous_names":["fishjam-dev/membrane_rtc_engine_timescaledb","jellyfish-dev/membrane_rtc_engine_timescaledb"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fishjam-dev/membrane_rtc_engine_timescaledb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishjam-dev%2Fmembrane_rtc_engine_timescaledb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishjam-dev%2Fmembrane_rtc_engine_timescaledb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishjam-dev%2Fmembrane_rtc_engine_timescaledb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishjam-dev%2Fmembrane_rtc_engine_timescaledb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fishjam-dev","download_url":"https://codeload.github.com/fishjam-dev/membrane_rtc_engine_timescaledb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fishjam-dev%2Fmembrane_rtc_engine_timescaledb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33717415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-06T09:12:10.667Z","updated_at":"2026-05-31T02:31:36.767Z","avatar_url":"https://github.com/fishjam-dev.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TimescaleDB metrics store for Membrane RTC Engine\n\n[![Hex.pm](https://img.shields.io/hexpm/v/membrane_rtc_engine_timescaledb.svg)](https://hex.pm/packages/membrane_rtc_engine_timescaledb)\n[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/membrane_rtc_engine_timescaledb)\n[![CircleCI](https://circleci.com/gh/jellyfish-dev/membrane_rtc_engine_timescaledb.svg?style=svg)](https://circleci.com/gh/jellyfish-dev/membrane_rtc_engine_timescaledb)\n\nThis repository allows storing metrics from `Membrane.RTC.Engine` reports in a TimescaleDB database.\n\nIt is part of [Membrane Multimedia Framework](https://membrane.stream).\n\n## Installation\n\nThe package can be installed by adding `membrane_rtc_engine_timescaledb` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:membrane_rtc_engine_timescaledb, \"~\u003e 0.2.0\"}\n  ]\nend\n```\n\n## Usage\n\nTo use `membrane_rtc_engine_timescaledb`, you have to have:\n\n- running PostgreSQL database with Timescale extension\n- config for `:membrane_rtc_engine_timescaledb`\n- configured `Ecto` repo in your project\n- `Ecto` migration calling `Membrane.RTC.Engine.TimescaleDB.Migrations.up/1`\n\nTo create such a migration, execute `$ mix ecto.gen.migration create_rtc_engine_timescaledb_tables`, what will create new migration module, and add there calls to `up/0` and `down/0` from `Membrane.RTC.Engine.TimescaleDB.Migrations`. Your new migration module should look like the example below\n\n```elixir\ndefmodule MyApp.CreateRtcEngineTimescaledbTables do\n  use Ecto.Migration\n\n  alias Membrane.RTC.Engine.TimescaleDB.Migrations\n\n  @spec up() :: :ok\n  def up() do\n    :ok = Migrations.up()\n  end\n\n  @spec down() :: :ok\n  def down() do\n    :ok = Migrations.down()\n  end\nend\n```\n\nThen, execute `$ mix ecto.migrate` to run the newly created migration.\n\nTo set up config for this library, put the following line in your config file:\n\n```elixir\nconfig :membrane_rtc_engine_timescaledb, repo: MyApp.Repo, cleanup_interval: 60 * 60, metrics_lifetime: 60 * 60 * 24\n```\n\nwhere\n\n- `repo` (required) is a module in your project, that uses `Ecto.Repo`\n- `cleanup_interval` (default: 1 hour) is the number of seconds between database cleanups\n- `metrics_lifetime` (default: 24 hours) is the number of seconds that must pass from creation before each metric can be deleted during cleanup\n\n## Metrics visualisation with Grafana\n\nMetrics stored in the database using `membrane_rtc_engine_timescaledb` can be simply visualized using Grafana.\nTo start the dashboard with RTC Engine metrics, create a volume with Grafana configuration files taken from `priv/grafana/provisioning` and mount it in the Grafana container at the default location: `/etc/grafana/provisioning`.\nWhen assembling an Elixir release with a dependency on `membrane_rtc_engine_timescaledb` the config files will be put in `lib/membrane_rtc_engine_timescaledb-0.1.0/priv/grafana/provisioning` directory inside the release.\nIf you want to put them in a different location (e.g. one that doesn't contain the library version, possibly changing over time), create an additional release step in `mix.exs` and use `Membrane.RTC.Engine.TimescaleDB.GrafanaHelper.cp_grafana_directory/1` inside, like in the example below:\n\n```elixir\ndefmodule Example.MixProject do\n  use Mix.Project\n\n  def project do\n    [\n      project: :example_project,\n      ...\n      releases: [\n        example_project: [\n          steps: [:assemble, \u0026cp_grafana_config/1]\n        ]\n      ]\n    ]\n  end\n\n  defp cp_grafana_config(release) do\n    Membrane.RTC.Engine.TimescaleDB.GrafanaHelper.cp_grafana_directory(release.path)\n    release\n  end\nend\n```\n\nYou can create a volume containing `priv/grafana/provisioning`, by declaring it in your `docker-compose.yml`\n\n```yml\nvolumes:\n  grafana-provisioning:\n```\n\nand adding it to the container with the Elixir project and to the Grafana container\n\n```yml\nservices:\n  ...\n  elixir_project:\n    ...\n    volumes:\n      - type: volume\n        source: grafana-provisioning\n        target: \u003cpath to grafana/provisioning in the related Docker image\u003e\n  grafana:\n    ...\n    depends_on:\n      - elixir_project\n    volumes:\n      - type: volume\n        source: grafana-provisioning\n        target: /etc/grafana/provisioning\n        read_only: true\n        volume:\n          nocopy: true\n```\n\nBeyond that, you have to set the following environment variables for your docker container\n\n- `DB_NAME` - name of the database, that you store your metrics in\n- `DB_USERNAME` - username used to log into the database\n- `DB_PASSWORD` - password used to log into the database\n- `DB_URL` - database URL in the form of `host:port`, eg. `localhost:5432`\n\nTo see an example, of how you can pass volumes and environment variables to the Docker containers, see `membrane_videoroom` [docker-compose.yml](https://github.com/membraneframework/membrane_videoroom/blob/metrics-visualisation/docker-compose.yml)\n\n## Running tests\n\nTo start tests, you have to run `$ docker-compose up` command, to have a running database docker container. To set up the database before tests, run `$ MIX_ENV=test mix ecto.reset` in second terminal window. Tests can be run with `$ mix test --include long_running` command.\n\n## Copyright and License\n\nCopyright 2020, [Software Mansion](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=membrane_rtc_engine_timescaledb)\n\n[![Software Mansion](https://logo.swmansion.com/logo?color=white\u0026variant=desktop\u0026width=200\u0026tag=membrane-github)](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=membrane_template_plugin)\n\nLicensed under the [Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffishjam-dev%2Fmembrane_rtc_engine_timescaledb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffishjam-dev%2Fmembrane_rtc_engine_timescaledb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffishjam-dev%2Fmembrane_rtc_engine_timescaledb/lists"}