{"id":20710425,"url":"https://github.com/mobiletelesystems/bretrics-web","last_synced_at":"2025-09-27T11:30:23.212Z","repository":{"id":227057199,"uuid":"763522362","full_name":"MobileTeleSystems/bretrics-web","owner":"MobileTeleSystems","description":"Bretrics - Realtime user WebMonitoring","archived":false,"fork":false,"pushed_at":"2024-11-06T13:22:20.000Z","size":176,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-10T04:09:05.926Z","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":"CODE_OF_CONDUCT.md","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":"2024-02-26T13:05:47.000Z","updated_at":"2024-05-11T19:41:50.000Z","dependencies_parsed_at":"2024-03-11T11:57:41.360Z","dependency_job_id":"9d9497a6-41e8-4e93-9bf0-e2ea51d96616","html_url":"https://github.com/MobileTeleSystems/bretrics-web","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"b6f63ab10917d6ce1dff6b5d652092ed3e5248b5"},"previous_names":["mobiletelesystems/bretrics-web"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fbretrics-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fbretrics-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fbretrics-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fbretrics-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MobileTeleSystems","download_url":"https://codeload.github.com/MobileTeleSystems/bretrics-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234429245,"owners_count":18831240,"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:55.256Z","updated_at":"2025-09-27T11:30:23.201Z","avatar_url":"https://github.com/MobileTeleSystems.png","language":"TypeScript","readme":"[![Codacy Badge](https://app.codacy.com/project/badge/Grade/e9e573d8408945168d14d83c81a103e6)](https://www.codacy.com/gh/LabEG/reca/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=LabEG/reca\u0026amp;utm_campaign=Badge_Grade)\n[![npm version](https://img.shields.io/npm/v/react.svg?style=flat)](https://www.npmjs.com/package/reca)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)\n[![GitHub license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/LabEG/reca/blob/main/LICENSE)\n\n# Bretrics - Realtime user Browser Monitoring\n\nMonitor the performance of the user's browser and code for real users. Allows you to collect WebVitals metrics, performance and business metrics through the Prometheus monitoring system.\n\n## Features\n\n- **WebVitals** - allows you to collect the main performance metrics of the [WebVitals initiative](https://web.dev/vitals/),\n- **Custom Metrics** - allows you to collect the [custom performance metrics](https://web.dev/custom-metrics/),\n- **Business Metrics** - allows you to collect any business metrics and sales funnels,\n- **Network Metrics** - allows you to evaluate the quality of the connection from clients to your servers,\n- **Leaks Detection** - allows you to detect leaks in DOM elements, listeners, js and others.\n\n## Installation\n\nnpm:\n\n```bash\nnpm install @mts-pjsc/bretrics\n```\n\nyarn\n\n```bash\nyarn add @mts-pjsc/bretrics\n```\n\n## Examples\n\n### Example Default Monitoring\n\nThe package has a pre-configured monitoring mode that includes the necessary webvitals metrics.\n\n``` typescript\nimport {bretrics} from \"@mts-pjsc/bretrics\";\n\nbretrics\n    .setup({apiPath: \"/bretrics\"}) // \u003c-- microservice deploy location\n    .useDefaultMonitoring()\n    .sendMetrics({my_metric: 5}); // \u003c-- custom metrics\n```\n\nIf you need to send custom metric, you must use the `sendMetrics` method.\n\n### Example Metrics with labels\n\nPrometheus labels can be set as default for all metrics, or individually for each value.\n\n``` typescript\nimport {bretrics} from \"@mts-pjsc/bretrics\";\n\nbretrics\n    .setup({apiPath: \"/bretrics\"})\n    .useDefaultMonitoring()\n    .setLabels({stage: \"beta\", path: location.pathname})\n    .sendMetrics({\n        my_metric: {\n            value: 5,\n            labels: {path: \"/blog\"}\n        }\n    });\n```\n\nThe default labels will be added to the metrics if you didn't pass them in the `sendMetrics` method.\n\n### Example Bretrics customization\n\nThe library exports the web monitoring constructor class, so you can inherit from it and implement logic according to OOP principles.\n\n``` typescript\nimport {Bretrics} from \"@mts-pjsc/bretrics\";\n\nexport class BretricsService extends Bretrics {\n\n    public override sendMetrics (metric: Record\u003cstring, number\u003e): this {\n        super.sendMetrics(metric);\n\n        // ... your code here ...\n\n        return this;\n    }\n\n}\n```\n\n## License\n\nWebMon is [MIT licensed](https://github.com/LabEG/reca/blob/main/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiletelesystems%2Fbretrics-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobiletelesystems%2Fbretrics-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiletelesystems%2Fbretrics-web/lists"}