{"id":34502011,"url":"https://github.com/aerospike-community/aerospike-graphite","last_synced_at":"2025-12-24T02:06:02.414Z","repository":{"id":19375522,"uuid":"22615982","full_name":"aerospike-community/aerospike-graphite","owner":"aerospike-community","description":"Aerospike monitoring for Graphite - a community driven open source project","archived":false,"fork":false,"pushed_at":"2021-03-19T19:56:48.000Z","size":210,"stargazers_count":14,"open_issues_count":0,"forks_count":7,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-03-23T01:36:35.021Z","etag":null,"topics":["aerospike","graphite","monitoring"],"latest_commit_sha":null,"homepage":"https://www.aerospike.com/docs/operations/monitor/index.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aerospike-community.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}},"created_at":"2014-08-04T18:54:17.000Z","updated_at":"2022-11-30T13:18:55.000Z","dependencies_parsed_at":"2022-08-24T01:11:01.957Z","dependency_job_id":null,"html_url":"https://github.com/aerospike-community/aerospike-graphite","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/aerospike-community/aerospike-graphite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerospike-community%2Faerospike-graphite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerospike-community%2Faerospike-graphite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerospike-community%2Faerospike-graphite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerospike-community%2Faerospike-graphite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aerospike-community","download_url":"https://codeload.github.com/aerospike-community/aerospike-graphite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerospike-community%2Faerospike-graphite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27992996,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"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":["aerospike","graphite","monitoring"],"created_at":"2025-12-24T02:05:58.486Z","updated_at":"2025-12-24T02:06:02.400Z","avatar_url":"https://github.com/aerospike-community.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aerospike Graphite\n\n## Introduction\n\nThe `asgraphite.py` script gets Aerospike metrics into [Graphite](https://graphiteapp.org/). It is compatible with Aerospike database 4.x and Aerospike database 5, last tested with database server versions 4.9.9 and 5.1.0.\n\n## Aerospike Monitoring Stack\nFor monitoring and alerting you should consider using the Prometheus and Grafana based [Aerospike Monitoring Stack](https://github.com/aerospike/aerospike-monitoring). This is the monitoring solution being developed by Aerospike.\n\n## Community Development\n\nThis repository has been turned over to the community. If you wish to contribute code, go ahead and clone this repo, modify the code, and create a pull request.\n\nActive contributors can then ask to become maintainers for the repo. The wiki can similarly be modified by any code contributor who has been granted pull permissions.\n\n\n### Requirements\nAdditional python modules are required and installed using pip:\n```\nsudo pip install -r requirements.txt\n```\n\nSee requirements.txt\n\nFor more information see the [Aerospike Python Client Installation page](https://github.com/aerospike/aerospike-client-python)\n\n### Getting Started\n1. Copy asgraphite.py to /opt/aerospike/bin/asgraphite\n    \u003e The script requires python 3.\u003cBR\u003e\n    \u003e The script requires python argparse.\u003cBR\u003e\n    \u003e The script requires Aerospike Python Client version 3.10.0+.\n1. Ensure the aerospike log directory exists. `/var/log/aerospike/`\n1. Issue the aerospike Graphite command\n1. Ensure asgraphite.py is running properly.\n```\ntail -f /var/log/aerospike/asgraphite.log\n\nStarting asgraphite daemon Tue Aug 18 17:11:10 2020\nAerospike-Graphite connector started:  Tue Aug 18 17:11:10 2020\n```\n\n### Usage\n```bash\n$ python /opt/aerospike/bin/asgraphite --help\nusage: asgraphite.py [-h] [-U USER] [-P [PASSWORD]] [-c CREDENTIALS]\n                     [--auth-mode AUTH_MODE]\n                     [--stop | --start | --once | --restart] [--stdout] [-v]\n                     [-n] [-s] [-l LATENCY [LATENCY ...]] [-x DC [DC ...]]\n                     [-g GRAPHITE_SERVER] [--interval GRAPHITE_INTERVAL]\n                     [--prefix GRAPHITE_PREFIX] [--hostname HOSTNAME]\n                     [-i INFO_PORT] [-b BASE_NODE] [-f LOG_FILE] [-si]\n                     [-hi HIST_DUMP [HIST_DUMP ...]] [--timeout TIMEOUT]\n                     [--tls-enable] [--tls-name TLS_NAME]\n                     [--tls-keyfile TLS_KEYFILE]\n                     [--tls-keyfile-pw TLS_KEYFILE_PW]\n                     [--tls-certfile TLS_CERTFILE] [--tls-cafile TLS_CAFILE]\n                     [--tls-capath TLS_CAPATH] [--tls-ciphers TLS_CIPHERS]\n                     [--tls-protocols TLS_PROTOCOLS]\n                     [--tls-cert-blacklist TLS_CERT_BLACKLIST]\n                     [--tls-crl-check] [--tls-crl-check-all]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -U USER, --user USER  user name\n  -P [PASSWORD], --password [PASSWORD]\n                        password\n  -c CREDENTIALS, --credentials-file CREDENTIALS\n                        Path to the credentials file. Use this in place of\n                        --user and --password.\n  --auth-mode AUTH_MODE\n                        Authentication mode. Values: ['INTERNAL',\n                        'EXTERNAL_INSECURE', 'EXTERNAL'] (default: INTERNAL)\n  --stop                Stop the Daemon\n  --start               Start the Daemon\n  --once                Run the script once\n  --restart             Restart the Daemon\n  --stdout              Print metrics output to stdout. Only useful with\n                        --once\n  -v, --verbose         Enable verbose logging\n  -n, --namespace       Get all namespace statistics\n  -s, --sets            Gather set based statistics\n  -l LATENCY [LATENCY ...], --latency LATENCY [LATENCY ...]\n                        Enable latency statistics and specify query (ie.\n                        latency:back=70;duration=60 or\n                        latencies:hist={NS}-benchmark-write)\n  -x DC [DC ...], --xdr DC [DC ...]\n                        Gather XDR datacenter statistics\n  -g GRAPHITE_SERVER, --graphite GRAPHITE_SERVER\n                        REQUIRED: IP:PORT for Graphite server. This argument\n                        can be specified multiple times to send to multiple\n                        servers\n  --interval GRAPHITE_INTERVAL\n                        How often metrics are sent to graphite (seconds)\n  --prefix GRAPHITE_PREFIX\n                        Prefix used when sending metrics to Graphite server\n                        (default: aerospike.cluster)\n  --hostname HOSTNAME   Hostname used when sending metrics to Graphite server\n                        (default: ubuntu)\n  -i INFO_PORT, --info-port INFO_PORT\n                        PORT for Aerospike server (default: 3000)\n  -b BASE_NODE, --base-node BASE_NODE\n                        Base host for collecting stats (default: 127.0.0.1)\n  -f LOG_FILE, --log-file LOG_FILE\n                        Logfile for asgraphite (default:\n                        /var/log/aerospike/asgraphite.log)\n  -si, --sindex         Gather sindex based statistics\n  -hi HIST_DUMP [HIST_DUMP ...], --hist-dump HIST_DUMP [HIST_DUMP ...]\n                        Gather histogram data. Valid args are ttl and objsz\n  --timeout TIMEOUT     Set timeout value in seconds to node level operations.\n                        (default: 5)\n  --tls-enable          Enable TLS\n  --tls-name TLS_NAME   The expected name on the server side certificate\n  --tls-keyfile TLS_KEYFILE\n                        The private keyfile for your client TLS Cert\n  --tls-keyfile-pw TLS_KEYFILE_PW\n                        Password to load protected tls-keyfile\n  --tls-certfile TLS_CERTFILE\n                        The client TLS cert\n  --tls-cafile TLS_CAFILE\n                        The CA for the server's certificate\n  --tls-capath TLS_CAPATH\n                        The path to a directory containing CA certs and/or\n                        CRLs\n  --tls-ciphers TLS_CIPHERS\n                        Ciphers to include. See https://www.openssl.org/docs/m\n                        an1.1.0/man1/ciphers.html for cipher list format\n  --tls-protocols TLS_PROTOCOLS\n                        The TLS protocol to use. Available choices: TLSv1,\n                        TLSv1.1, TLSv1.2, all. An optional + or - can be\n                        appended before the protocol to indicate specific\n                        inclusion or exclusion.\n  --tls-cert-blacklist TLS_CERT_BLACKLIST\n                        Blacklist including serial number of certs to revoke\n  --tls-crl-check       Checks SSL/TLS certs against vendor's Certificate\n                        Revocation Lists for revoked certificates. CRLs are\n                        found in path specified by --tls-capath. Checks the\n                        leaf certificates only\n  --tls-crl-check-all   Check on all entries within the CRL chain\n```\n\n### Examples\n\n```bash\n# Note: Retrieving the latency/latencies histograms mimics the equivalent asinfo command.\n# If a latency command is in an incorrect format it will default to either \"latency:\" or \"latencies:\"\n# depending on the server version.\n\n# To send just the (using defaults) latencies (5.1+) information to Graphite\n$ python /opt/aerospike/bin/asgraphite -l 'latencies:' --start -g \u003cgraphite_host:graphite_port\u003e\n\n# To send benchamrk latencies (5.1+) along with the defaults to Graphite.\n$ python /opt/aerospike/bin/asgraphite -l 'latencies:' ['latencies:hist={test}-benchmarks-write' 'latencies:hist={test}-benchmarks-read' ...] --start -g \u003cgraphite_host:graphite_port\u003e\nor\n$ python /opt/aerospike/bin/asgraphite -l 'latency:' [-l 'latencies:hist={test}-benchmarks-write' -l 'latencies:hist={test}-benchmarks-read' ...] --start -g \u003cgraphite_host:graphite_port\u003e\n\n#  To send just the (using defaults) latency (pre 5.1) information to Graphite\n$ python /opt/aerospike/bin/asgraphite -l 'latency:' --start -g \u003cgraphite_host:graphite_port\u003e\n\n#  To send the latency (pre 5.1) information of custom duration to Graphite.\n#  This would go back 70 seconds and send latency to the Graphite server for 60 seconds worth of data.\n$ python /opt/aerospike/bin/asgraphite -l 'latency:back=70;duration=60' --start -g \u003cgraphite_host:graphite_port\u003e\n\n#  To send the latency information of custom duration to Graphite.\n#  This would go back 70 seconds and send latency, set and namespace data to the Graphite server for 60 seconds worth of data.\n$ python /opt/aerospike/bin/asgraphite -n -l 'latency:back=70;duration=60' --start -g \u003cgraphite_host\u003e -p \u003cgraphite_port\u003e\n\n#  To send just the statistics information to Graphite\n$ python /opt/aerospike/bin/asgraphite --start -g \u003cgraphite_host:graphite_port\u003e\n\n#  To send namespace stats to Graphite\n$ python /opt/aerospike/bin/asgraphite -n --start -g \u003cgraphite_host:graphite_port\u003e\n\n#  To send sets info to Graphite\n$ python /opt/aerospike/bin/asgraphite -s --start -g \u003cgraphite_host:graphite_port\u003e\n\n#  To send XDR statistics to Graphite\n$ python /opt/aerospike/bin/asgraphite -x datacenter1 [dc2 dc3 ...] --start -g \u003cgraphite_host:graphite_port\u003e\nor\n$ python /opt/aerospike/bin/asgraphite -x datacenter1 [-x datacenter 2 -x datacenter3 ...] --start -g \u003cgraphite_host:graphite_port\u003e\n\n#  To send SIndex statistics to Graphite\n$ python /opt/aerospike/bin/asgraphite -si --start -g \u003cgraphite_host:graphite_port\u003e\n\n# You can use multiple options in a single command\n$ python /opt/aerospike/bin/asgraphite -si -l 'latency:' --start -g \u003cgraphite_host:graphite_port\u003e\n\n#  To Stop the Daemon\n$ python /opt/aerospike/bin/asgraphite --stop\n\n#  To run with SSL/TLS authenticate server\n$ python /opt/aerospike/bin/asgraphite -n --tls-enable --tls-cafile /path/to/CA/root.pem --tls-name \u003cserver name on cert\u003e --start -g \u003cgraphite_host:graphite_port\u003e\n\n#  To ship to multiple destinations:\n$ python /opt/aerospike/bin/asgraphite --start -g \u003cgraphite_host1:graphite_port1\u003e -g \u003cgraphite_host2:graphite_port2\u003e ...\n\n```\n\nAdd the asgraphite monitoring commands to `/etc/rc.local` to automatically start\nmonitoring after a server restart.\n\n### Authentication\n\nYou can specify User and Password for authentication via the -U/--user and -P/--password parameters.\nThe Password is also an interactive prompt if you leave it empty.\n\nIf this is not preferable, you can also specify a credentials file with -c/--credentials-file. It is a simple 2 line file, with the username and password on each line, in that order. With this method, the credentials file can be secured via other means (eg: chmod 600) and prevent snooping.\n\n### Logfile Management\n\nAn example logrotate file is provided. Move/rename the asgraphite.logrotate into your logrotate.d dir (eg: /etc/logrotate.d)\n\n**Note**\nThis script is not aware of journalctl, as such it is not completely compatible with SystemD OSs. If your OS is a SystemD OS (RedHat 7, Ubuntu 16+), you would need to reinstall logrotate. Otherwise the generated log will grow without end.\n\n### Grafana\nThe aerospike dashboard provided uses variables to allow switching between different\nAerospike clusters. When launching asgraphite.py be sure to provide a --prefix argument \nto label your clusters appropriately. Example prefix: `aerospike.cluster-west`.\n\n**Note**\nGrafana and Aerospike Server both use port 3000 by default.  To run both on the same\nhost you will need to change the port used by Grafana in grafana.ini.\n\n### Dependencies\n- python version 3.4+.\u003cBR\u003e\n- python argparse.\u003cBR\u003e\n- Aerospike Python Client version 3.10.0+.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerospike-community%2Faerospike-graphite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faerospike-community%2Faerospike-graphite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerospike-community%2Faerospike-graphite/lists"}