{"id":16906312,"url":"https://github.com/arjunmahishi/randome","last_synced_at":"2025-04-11T15:23:28.639Z","repository":{"id":200306143,"uuid":"607224916","full_name":"arjunmahishi/randOME","owner":"arjunmahishi","description":"A CLI tool to generate a pseudo-random stream of open metrics workload to help debug observability tools","archived":false,"fork":false,"pushed_at":"2023-10-15T12:36:32.000Z","size":50,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T11:36:45.756Z","etag":null,"topics":["cli","debugging-tool","prometheus","tsdb","victoriametrics"],"latest_commit_sha":null,"homepage":"","language":"Go","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/arjunmahishi.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}},"created_at":"2023-02-27T15:12:45.000Z","updated_at":"2024-04-03T10:20:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8ea57ab-8dee-4215-a0b3-152a8b335705","html_url":"https://github.com/arjunmahishi/randOME","commit_stats":null,"previous_names":["arjunmahishi/randome"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunmahishi%2FrandOME","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunmahishi%2FrandOME/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunmahishi%2FrandOME/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunmahishi%2FrandOME/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arjunmahishi","download_url":"https://codeload.github.com/arjunmahishi/randOME/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429673,"owners_count":21101874,"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":["cli","debugging-tool","prometheus","tsdb","victoriametrics"],"created_at":"2024-10-13T18:42:08.872Z","updated_at":"2025-04-11T15:23:28.578Z","avatar_url":"https://github.com/arjunmahishi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RandOME\n\nA CLI tool to generate a (pseudo)random stream of open metrics data for debugging prometheus based TSDBs and tools that depend on it. This is very similar to [Avalanche](https://github.com/prometheus-community/avalanche). While avalanche focuses more on the \"load testing\" aspect of things, randOME focuses more on the actual data generated. \n\nBy controlling the shape of the data, you can test/debug/benchmark specific scenarios related to alerting, visualization, storage, and performance. With randOME, you can create more targeted and meaningful tests that enable you to optimize your systems more effectively.\n\n---\n\n## Configuration\n\nThis tool can be configured with a simple YAML file. Here's a sample config:\n\n```yaml\nmetrics:\n  - name: metric_1\n    value_min: 0\n    value_max: 100\n    labels:\n      instance: [localhost:8080]\n      cluster: [dev, prod, staging, test, qa]\n\n  - name: metric_2\n    max_cardinality: 10\n    labels:\n      method: [GET, POST, PUT, DELETE]\n      status: [200, 400, 404, 500]\n```\n\n**Attributes**\n\n| Field         | Type                 | Description |\n|---------------|----------------------|-------------|\n| `Name`        | `string`             | The name of the metric. |\n| `ValueMin`    | `number`                | The minimum value that the metric can have. |\n| `ValueMax`    | `number`                | The maximum value that the metric can have. |\n| `Value`       | `number`           | The static value of the metric. This field is optional. |\n| `Labels`      | `map[string][]string`| The labels associated with the metric, as a map of string to string slices (refer to the above examples for the exact format). |\n| `MaxCardinality`| `number`              | The maximum number of unique label value combinations that can be associated with the metric. This field is optional. |\n\n## Easiest way to run\n\n**Emit default metrics**\n\n```bash\n$ docker run -d -p 9090:9090 arjunmahishi/randome\n```\n\n**Emit custom metrics**\n\n```bash\n$ cat \u003e sample.yaml \u003c\u003cEOF\nmetrics:\n  - name: metric_1\n    value_min: 0\n    value_max: 100\n    labels:\n      instance: [localhost:8080]\n      cluster: [dev, prod, staging, test, qa]\n\n  - name: metric_2\n    max_cardinality: 10\n    labels:\n      method: [GET, POST, PUT, DELETE]\n      status: [200, 400, 404, 500]\nEOF\n\n$ docker run -d -p 9090:9090 -v $(pwd)/sample.yaml:/app/sample.yaml  arjunmahishi/randome\n```\n\n**Remote write default metrics**\n\n```bash\n$ docker run -d -e REMOTE_WRITE_ADDR='http://\u003cprometheus-compatible-host\u003e/api/v1/write' arjunmahishi/randome\n```\n\n**Remote write custom metrics**\n\n```bash\n$ cat \u003e sample.yaml \u003c\u003cEOF\nmetrics:\n  - name: metric_1\n    value_min: 0\n    value_max: 100\n    labels:\n      instance: [localhost:8080]\n      cluster: [dev, prod, staging, test, qa]\n\n  - name: metric_2\n    max_cardinality: 10\n    labels:\n      method: [GET, POST, PUT, DELETE]\n      status: [200, 400, 404, 500]\nEOF\n\n$ docker run -d -e REMOTE_WRITE_ADDR='http://\u003cprometheus-compatible-host\u003e/api/v1/write' -v $(pwd)/sample.yaml:/app/sample.yaml arjunmahishi/randome\n```\n\n## Building locally\n\n```\n# for your OS\nmake build\n\n# for a specific OS (check the makefile to see if the command is available for the OS you're looking for)\nmake build_\u003cplatform\u003e\n\n# both commands will create an executable binary in ./bin\n```\n\n## Running the binary directly\n\n```\n$ randOME --help\nusage: randOME [\u003cflags\u003e] \u003ccommand\u003e [\u003cargs\u003e ...]\n\nFlags:\n      --help           Show context-sensitive help (also try --help-long and --help-man).\n  -f, --frequency=4s   Frequency of data points\n  -c, --config=CONFIG  path to the config file\n      --version        Show application version.\n\nCommands:\n  help [\u003ccommand\u003e...]\n    Show help.\n\n  print\n    print the data to stdout\n\n  remote-write --addr=ADDR\n    Remote write to a Prometheus-compatible TSDB\n\n  emit [\u003cflags\u003e]\n    Emit metrics over HTTP on a given port (localhost:\u003cport\u003e/metrics)\n```\n\n**Print metrics to STDOUT**\n\n```\nrandOME print -f 5s\n```\n\n**Emit metrics over HTTP**\n\n```\nrandOME emit -f 5s\n```\n\n**Remote write to a prometheus compatible storage**\n\n```\nrandOME remote-write -f 5s --addr http://localhost:8428/api/v1/write\n```\n\n**Defining custom metrics**\n\n```\n$ cat sample.yaml\nmetrics:\n  - name: cpu_usage\n    value_min: 0\n    value_max: 100\n    labels:\n      instance: [localhost:8080]\n      cluster: [dev, prod, staging, test, qa]\n\n  - name: requests_total\n    max_cardinality: 10\n    labels:\n      method: [GET, POST, PUT, DELETE]\n      status: [200, 400, 404, 500]\n\n$ randOME print -c sample.yaml -f 5s\nrequests_total{status='200',method='GET'} 2\nrequests_total{status='400',method='GET'} 7\nrequests_total{status='404',method='GET'} 6\nrequests_total{status='500',method='GET'} 0\nrequests_total{status='200',method='POST'} 5\nrequests_total{status='400',method='POST'} 3\nrequests_total{method='POST',status='404'} 4\nrequests_total{method='POST',status='500'} 3\nrequests_total{status='200',method='PUT'} 9\nrequests_total{status='400',method='PUT'} 6\ncpu_usage{instance='localhost:8080',cluster='dev'} 21\ncpu_usage{instance='localhost:8080',cluster='prod'} 52\ncpu_usage{instance='localhost:8080',cluster='staging'} 36\ncpu_usage{instance='localhost:8080',cluster='test'} 5\ncpu_usage{instance='localhost:8080',cluster='qa'} 62\ncpu_usage{cluster='dev',instance='localhost:8080'} 94\ncpu_usage{instance='localhost:8080',cluster='prod'} 93\ncpu_usage{cluster='staging',instance='localhost:8080'} 80\ncpu_usage{instance='localhost:8080',cluster='test'} 67\ncpu_usage{cluster='qa',instance='localhost:8080'} 59\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunmahishi%2Frandome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjunmahishi%2Frandome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunmahishi%2Frandome/lists"}