{"id":18000128,"url":"https://github.com/livewareproblems/orion","last_synced_at":"2025-04-05T03:09:43.270Z","repository":{"id":65825580,"uuid":"423265111","full_name":"LivewareProblems/Orion","owner":"LivewareProblems","description":"Distributed Dynamic Profiling for the BEAM","archived":false,"fork":false,"pushed_at":"2024-02-13T15:40:34.000Z","size":908,"stargazers_count":172,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-17T09:16:33.671Z","etag":null,"topics":["elixir","phoenix","profiling"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"spawnfest/Orion","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LivewareProblems.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-10-31T21:32:42.000Z","updated_at":"2024-10-16T06:58:20.000Z","dependencies_parsed_at":"2023-12-16T16:31:49.070Z","dependency_job_id":"b5e50aa0-9c2c-4bb3-8408-770e2f6f3c1e","html_url":"https://github.com/LivewareProblems/Orion","commit_stats":{"total_commits":69,"total_committers":4,"mean_commits":17.25,"dds":0.04347826086956519,"last_synced_commit":"47fd315f32c99d6d30338fb47b05d6c791e2f174"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivewareProblems%2FOrion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivewareProblems%2FOrion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivewareProblems%2FOrion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivewareProblems%2FOrion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LivewareProblems","download_url":"https://codeload.github.com/LivewareProblems/Orion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280272,"owners_count":20912967,"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","profiling"],"created_at":"2024-10-29T23:09:45.366Z","updated_at":"2025-04-05T03:09:43.236Z","avatar_url":"https://github.com/LivewareProblems.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Orion\n\n[Official Documentation on Hexdoc](https://hexdocs.pm/orion/Orion.html)\n\u003c!-- MDOC !--\u003e\n\nOrion is a Dynamic Distributed Profiler. It allows you to profile any function\nin a beam cluster and get back an histogram representing the profile of the\nfunction calls across the whole cluster. Live, with low overhead, making it\nsuitable to run in production. It uses Erlang dynamic tracing under the hood.\n\nIt is meant to be used as a library in part of your existing application.\n\nIf you run your application non clustered, you will be able to trace the node\nyou connect to.\n\nIf your applications are connected via Distributed Erlang, then you will get\na histogram of every call on every node, aggregated.\n\n![screenshot](https://github.com/LivewareProblems/Orion/raw/main/screenshot.png)\n\n## Non Goals\n\n- Be useable in any BEAM language. This may happen in the future but for now we\n  depend on dog_sketch which is in elixir\n- Making it easy to run the UI locally and connect remotely to a cluster. This\n  may come in the future or in a paid extension. If you are interested, [contact\n  me on the Elixir Forum](https://elixirforum.com/u/dianaolympos/summary). In\n  the meantime, you can use the `mix dev` local development setup as a starting\n  point to do your own. Orion totally work remotely connected with erlang\n  distribution, so as long as you can connect to your cluster (and deactivate\n  the `:self_profile` option in your endpont), it should just work.\n- Session handling, in particular personal auth, and more. This may come in the\n  future or in a paid extension. If you are interested, [contact me on the\n  Elixir Forum](https://elixirforum.com/u/dianaolympos/summary). Refreshes clean\n  up the UI.\n\n## Installation\n\nTo start using Orion, you will need three steps:\n\n1. Add the `orion` dependency\n2. Configure LiveView\n3. Add UI access\n\n### 1. Add the `orion` dependency\n\nAdd the following to your `mix.exs` and run `mix deps.get`:\n\n```elixir\ndef deps do\n  [\n    {:orion, \"~\u003e 1.0\"}\n  ]\nend\n```\n\n### 2. Configure LiveView\n\nThe Orion UI is built on top of LiveView. If LiveView is already installed in\nyour app, feel free to skip this section.\n\nIf you plan to use LiveView in your application in the future, we recommend you\nto follow [the official installation\ninstructions](https://hexdocs.pm/phoenix_live_view/installation.html). This\nguide only covers the minimum steps necessary for the Orion UI itself to run.\n\nFirst, update your endpoint's configuration to include a signing salt. You can\ngenerate a signing salt by running `mix phx.gen.secret 32` (note Phoenix v1.5+\napps already have this configuration):\n\n```elixir\n# config/config.exs\nconfig :my_app, MyAppWeb.Endpoint,\n  live_view: [signing_salt: \"SECRET_SALT\"]\n```\n\nThen add the `Phoenix.LiveView.Socket` declaration to your endpoint:\n\n```elixir\nsocket \"/live\", Phoenix.LiveView.Socket\n```\n\nAnd you are good to go!\n\n### 3. Add Orion UI access for development-only usage\n\nOnce installed, update your router's configuration to forward requests to an\nOrionWeb with a unique `name` of your choosing:\n\n```elixir\n# lib/my_app_web/router.ex\nuse MyAppWeb, :router\nimport OrionWeb.Router\n...\nif Mix.env() == :dev do\n  scope \"/\" do\n    pipe_through [:browser]\n    live_orion \"/orion\"\n  end\nend\n```\n\nThis is all. Run `mix phx.server` and access the \"/orion\" to start profiling.\n\n### Extra: Add Orion access on all environments (including production)\n\nIf you want to use the Orion UI in production, you should put it behind some\nauthentication and allow only admins to access it.\n\nIf you have an authentication layer already for admins, `live_orion` accept an\n`:on_mount` option, to specify the hooks to validate your authentication, as\ndescribed in the [official phoenix guide about\nsecurity](https://hexdocs.pm/phoenix_live_view/security-model.html#mounting-considerations)\n\nIf your application does not have an admins-only section yet, you can use\n`Plug.BasicAuth` to set up some basic authentication as long as you are also\nusing SSL (which you should anyway):\n\n```elixir\n# lib/my_app_web/router.ex\nuse MyAppWeb, :router\nimport OrionWeb.Router\n...\npipeline :admins_only do\n  plug :admin_basic_auth\nend\nscope \"/\" do\n  pipe_through [:browser, :admins_only]\n    live_orion \"/orion\"\nend\ndefp admin_basic_auth(conn, _opts) do\n  username = System.fetch_env!(\"AUTH_USERNAME\")\n  password = System.fetch_env!(\"AUTH_PASSWORD\")\n  Plug.BasicAuth.basic_auth(conn, username: username, password: password)\nend\n```\n\nIf you are running your application behind a proxy or a webserver, you also have\nto make sure they are configured for allowing WebSocket upgrades. For example,\n[here is an\narticle](https://web.archive.org/web/20171104012240/https://dennisreimann.de/articles/phoenix-nginx-config.html)\non how to configure Nginx with Phoenix and WebSockets.\n\nFinally, you will also want to configure your `config/prod.exs` and use your\ndomain name under the `check_origin` configuration:\n\n```elixir\n    check_origin: [\"//myapp.com\"]\n```\n\nThen you should be good to go!\n\n\u003c!-- MDOC !--\u003e\n\n## Contributing\n\nYou need elixir 1.12+ and OTP 24+.\n\nOrion is a phoenix liveview application for the frontend.\n\nTo start your Phoenix server:\n\n- Install dependencies with `mix setup`\n\nIf you want to see it in action\n\n- Start the development endpoint with `mix dev`\n\nNow you can visit [`localhost:4001`](http://localhost:4001) from your browser.\n\n## License\n\nMIT License. Copyright (c) 2023 Thomas Depierre.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivewareproblems%2Forion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivewareproblems%2Forion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivewareproblems%2Forion/lists"}