{"id":26910304,"url":"https://github.com/srvariable/mongo-exporter","last_synced_at":"2025-04-01T13:34:25.393Z","repository":{"id":283135010,"uuid":"950492834","full_name":"SrVariable/mongo-exporter","owner":"SrVariable","description":"Sistema de recopilación de métricas de MongoDB para monitorizar los datos","archived":false,"fork":false,"pushed_at":"2025-03-27T12:31:49.000Z","size":62,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-27T13:32:16.210Z","etag":null,"topics":["go","metrics-gathering"],"latest_commit_sha":null,"homepage":"","language":"Go","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/SrVariable.png","metadata":{"files":{"readme":"README.en.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-18T08:49:18.000Z","updated_at":"2025-03-24T11:34:49.000Z","dependencies_parsed_at":"2025-03-18T18:50:27.227Z","dependency_job_id":"de071b34-1fd9-4ae8-9aff-0798c0f8bf03","html_url":"https://github.com/SrVariable/mongo-exporter","commit_stats":null,"previous_names":["srvariable/pracgo","srvariable/mongo-exporter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrVariable%2Fmongo-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrVariable%2Fmongo-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrVariable%2Fmongo-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrVariable%2Fmongo-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SrVariable","download_url":"https://codeload.github.com/SrVariable/mongo-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246647733,"owners_count":20811371,"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":["go","metrics-gathering"],"created_at":"2025-04-01T13:32:57.894Z","updated_at":"2025-04-01T13:34:25.383Z","avatar_url":"https://github.com/SrVariable.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongo-exporter\n\nThis project consists in a Metric Collection System for a database to monitor\nthe data. It's developped as part of my first year internship in\n[iAR Soft](https://www.iar-soft.com/).\n\n# API Endpoints\n\n|Method|Endpoint|Description|\n|-|-|-|\n|`GET`|`/v1/healthcheck`|Get the health status of the API|\n|`GET`|`/v1/hello`|Get \"hello world\" message|\n|`GET`|`/v1/metrics/opcounters`|Get a list of operation counters|\n|`GET`|`/v1/metrics/opcounters/:name`|Get an operation counter by name|\n|`GET`|`/v1/metrics/cpu`|Get the CPU usage in 1 second|\n|`GET`|`/v1/metrics/ram`|Get the RAM usage|\n\n# Usage\n\nClone the repository\n```\ngit clone https://github.com/SrVariable/mongo-exporter\n```\n\nNavigate to the project folder\n```\ncd mongo-exporter\n```\n\nCreate `.env` file following the `.env.example` file to configure the environment\nvariables. For default configuration, just copy `.env.example` to `.env`:\n```\ncp .env.example .env\n```\n\n`.env` file should look like this:\n```\nAPP_PORT=8080\nDB_NAME=MyDatabaseName\nDB_HOST=mongo\nDB_PORT=27017\n```\n\nBuild the containers\n```\nmake\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e If you don't have `make`, you can run:\n\u003e ```\n\u003e docker compose down\n\u003e docker compose up --build -d\n\u003e ```\n\nOnce it's built, you can interact with the API using your browser, curl, or\nany method you prefer.\n\n- To get a list of metrics:\n```\ncurl http://localhost:8080/v1/metrics\n```\n\n- To get the amount of inserts to a database\n```\ncurl http://localhost:8080/v1/metrics/insert\n```\n\nCheck [API Endpoints](#api-endpoints) to see available endpoints.\n\n# References\n\n- https://go.dev/doc/tutorial/web-service-gin\n- https://youtu.be/67yGbvyM1is\n- https://gin-gonic.com/docs\n- https://github.com/gin-gonic/examples/tree/master/group-routes\n- https://stackoverflow.com/questions/33322103/multiple-froms-what-it-means\n- https://stackoverflow.com/questions/75973805/creating-dockerfile-for-golang-web-application\n- https://www.docker.com/blog/developing-go-apps-docker/\n- https://pkg.go.dev/go.mongodb.org/mongo-driver/v2/mongo\n- https://www.youtube.com/watch?v=bDWApqAUjEI\n- https://www.youtube.com/watch?v=g7cNQB2kCgE\n- https://www.mongodb.com/docs/manual/reference/command/serverStatus/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrvariable%2Fmongo-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrvariable%2Fmongo-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrvariable%2Fmongo-exporter/lists"}