{"id":49341725,"url":"https://github.com/redborder/events-counter","last_synced_at":"2026-04-27T04:04:50.663Z","repository":{"id":18648694,"uuid":"84835188","full_name":"redBorder/events-counter","owner":"redBorder","description":"Simple utility for counting messages on a Kafka topic.","archived":false,"fork":false,"pushed_at":"2026-02-20T15:41:16.000Z","size":107,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-20T20:07:51.442Z","etag":null,"topics":["autodelivery","redborder","redborder-ng","rpm","service"],"latest_commit_sha":null,"homepage":"https://redborder.github.io/events-counter/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redBorder.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-03-13T14:20:58.000Z","updated_at":"2026-02-20T15:37:21.000Z","dependencies_parsed_at":"2025-12-11T17:04:18.089Z","dependency_job_id":null,"html_url":"https://github.com/redBorder/events-counter","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/redBorder/events-counter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redBorder%2Fevents-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redBorder%2Fevents-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redBorder%2Fevents-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redBorder%2Fevents-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redBorder","download_url":"https://codeload.github.com/redBorder/events-counter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redBorder%2Fevents-counter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32321945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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":["autodelivery","redborder","redborder-ng","rpm","service"],"created_at":"2026-04-27T04:04:50.465Z","updated_at":"2026-04-27T04:04:50.656Z","avatar_url":"https://github.com/redBorder.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/redBorder/events-counter.svg?branch=master)](https://travis-ci.org/redBorder/events-counter)\n[![Coverage Status](https://coveralls.io/repos/github/redBorder/events-counter/badge.svg)](https://coveralls.io/github/redBorder/events-counter)\n[![Go Report Card](https://goreportcard.com/badge/github.com/redBorder/events-counter)](https://goreportcard.com/report/github.com/redBorder/events-counter)\n\n# events-counter\n\n* [Overview](#overview)\n* [Installing](#installing)\n* [Usage](#usage)\n* [Configuration](#configuration)\n\n## Overview\n\n`events-counter` is a simple utility that can be used for accounting messages\nin a Kafka topic. It supports accounting by number of bytes (regardless the\nnumber of messages).\n\nMessages are expected to be on JSON format when counting messages.\n\n`events-counter` has two independent modules:\n\n- **UUIDCounter**\n  - Reads messages from a set of input topics.\n  - Count the number of bytes of these messages.\n  - Sends a message periodically to an output topic with the account of bytes\n  on the inputs topic.\n- **CountersMonitor**\n  - The input topic of the counter monitor is the output topic of the UUIDCounter.\n  - Reads messages with the account of bytes. Discards old messages.\n  - If the number of total bytes exceeds the limit sends an alert.\n\n`events-counter` ignores Teldat sensors traffic, so these kind of sensors can\nsend an unlimited amount of bytes.  \n\n## License\n\n`events-counter` limits can't be configured. These limits are loaded from a\nLICENSE file. These licenses must be signed to be considered a valid license. Also, a\nlicense has an expiration time and it won't be considered valid after\nthe expiration time.\n\nThe public key used to verify the license should be specified at compile time\nand can't be modified once the binary is compiled. To specify the public key,\nthe application should be compiled like this:\n\n```bash\nexport PUBLIC_KEY=\"-----BEGIN PUBLIC KEY-----\\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0\\nFPqri0cb2JZfXJ/DgYSF6vUpwmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/\\n3j+skZ6UtW+5u09lHNsj6tQ51s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZwIDAQAB\\n-----END PUBLIC KEY-----\"\nmake\n```\n\n_**Note** that every line break should be **replaced** by \"\\n\"_\n\n## Installing\n\nTo install this application ensure you have the\n[GOPATH](https://golang.org/doc/code.html#GOPATH) environment variable set and\n**[glide](https://glide.sh/)** installed.\n\n```bash\ncurl https://glide.sh/get | sh\n```\n\nAnd then:\n\n1. Clone this repo and cd to the project\n\n    ```bash\n    git clone https://github.com/redBorder/events-counter \u0026\u0026 cd events-counter\n    ```\n2. Install dependencies and compile\n\n    ```bash\n    make\n    ```\n3. Install on desired directory\n\n    ```bash\n    prefix=/opt/events-counter/ make install\n    ```\n\n## Usage\n\nUsage of `events-counter`:\n\n```\n--version\n    Show version info\n--config string\n    Config file\n--debug\n    Print debug info\n```\n\n## Configuration\n\n```yaml\ncounters:\n  batch_timeout_s: 5                     # Max time to wait before send a count message\n  batch_max_messages: 1000               # Max number of messages to hold before send a count message\n  uuid_key: \"sensor_uuid\"                # JSON key for the UUID\n  kafka:                                 # Kafka configuration\n    write_topic: \"rb_monitor\"            # Topic to send the count\n    read_topics:                         # Topics to read messages for accounting\n      - \"rb_flow\"\n    attributes:                          # Custom internal rdkafka attributes\n      bootstrap.servers: \"kafka:9092\"\n      group.id: \"counters\"\n\nmonitor:\n  timer:\n    period: 86400                        # Width in seconds of the interval between counters reset (86400 -\u003e 24h)\n    offset: 0                            # Offset in seconds to change the start of the interval (0 -\u003e 00:00h)\n  kafka:                                 # Kafka configuration\n    write_topic: \"rb_limits\"             # Topic to send the alerts\n    read_topics:                         # Topics to read messages with accounting info\n      - \"rb_monitor\"\n    attributes:                          # Custom internal rdkafka attributes\n      bootstrap.servers: \"kafka:9092\"\n      enable.auto.commit: \"false\"        # IMPORTANT: Should be set to false\n      group.id: \"monitor\"\n\nlicenses_directory: /etc/licenses       # Path to the directory where licenses are stored\norganization_mode: false                # Ignore organization_uuid. Count every message as belonging to org \"*\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredborder%2Fevents-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredborder%2Fevents-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredborder%2Fevents-counter/lists"}