{"id":20710440,"url":"https://github.com/mobiletelesystems/bretrics","last_synced_at":"2025-07-01T14:08:14.867Z","repository":{"id":224540734,"uuid":"763521864","full_name":"MobileTeleSystems/bretrics","owner":"MobileTeleSystems","description":"Microservice for monitoring clients web applications by prometheus.","archived":false,"fork":false,"pushed_at":"2025-06-10T00:31:49.000Z","size":447,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-01T14:07:59.784Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MobileTeleSystems.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,"zenodo":null}},"created_at":"2024-02-26T13:04:40.000Z","updated_at":"2024-02-26T13:28:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"95f39dea-4d03-4165-a186-5f5a522364d3","html_url":"https://github.com/MobileTeleSystems/bretrics","commit_stats":null,"previous_names":["mobiletelesystems/bretrics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MobileTeleSystems/bretrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fbretrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fbretrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fbretrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fbretrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MobileTeleSystems","download_url":"https://codeload.github.com/MobileTeleSystems/bretrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fbretrics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262978664,"owners_count":23394012,"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":[],"created_at":"2024-11-17T02:11:59.328Z","updated_at":"2025-07-01T14:08:14.824Z","avatar_url":"https://github.com/MobileTeleSystems.png","language":"TypeScript","readme":"# Bretrics - Microservice for realtime monitoring of users in browsers by prometheus.\n\nThe microservice contains an API that accepts metrics from the client browser, as well as an exporter for Prometheus metrics..\n\n## Try\n\nTo try the microservice features, run the container with the command:\n\n```sh\ndocker run -it --rm -p 3000:3000 mtsrus/bretrics\n```\n\nNow you can check the work with the command:\n\n```sh\ncurl -d '{\"fcp\": 0.5, \"cls\": 1, \"tti\": 2}' -H 'Content-Type: application/json' -X POST http://localhost:3000/send-metrics/metrics\n```\n\nNow you can see sended metrics in the exporter by url `http://localhost:3000/metrics`.\n\nSend metrics with labels:\n\n```sh\ncurl -d '{\"fcp\": {\"value\": 5, \"labels\": {\"path\": \"/app\", \"type\": \"mobile\"}}}' -H 'Content-Type: application/json' -X POST http://localhost:3000/send-metrics/metrics\n```\n\n## Use\n\nTo start the microservice in production, use the command:\n\n```sh\ndocker run -d --restart always -p 3000:3000 mtsrus/bretrics\n```\n\n## Container parameters\n\n- `-e PORT=3000` - the port on which the microservice will be launched, default 3000.\n\n- `-e BRETRICS_PERCENTILES=[0.01, 0.1, 0.25, 0.5, 0.75, 0.9, 0.99]` - percentiles of prometheus values,\n    default [0.01, 0.1, 0.25, 0.5, 0.75, 0.9, 0.99].\n\n- `-e BRETRICS_MAXAGESECONDS=600` - will tell how old a bucket can be before it is reset, in seconds, default 600 seconds.\n\n- `-e BRETRICS_AGEBUCKETS=5` - configures how many buckets we will have in our sliding window for the summary, default 5.\n\n- `-e BRETRICS_PREFIX=\"bretrics_\"` - prefix of web monitoring values,\n    default bretrics_.\n\n- `-e PROM_ELPRECISION=100` - nodejs event loop precision for system metrics, default 100.\n\n- `-e PROM_PREFIX=\"\"` - prefix for all prometheus metrics,\n    default empty string.\n\n## Metrics Prometheus\n\nThe microservice has built-in Prometheus monitoring and is located on the endpoint `/metrics`.\n\nBlock this endpoint on the proxy if you do not need to provide access to metrics from outside your network.\n\n## Components for web\n\nTo send metrics from the client, you need to write code that will send metrics to the microservice. An [example of such code can be found here](https://web.dev/vitals/).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiletelesystems%2Fbretrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobiletelesystems%2Fbretrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiletelesystems%2Fbretrics/lists"}