{"id":13582501,"url":"https://github.com/prometheus/graphite_exporter","last_synced_at":"2025-04-06T14:31:00.683Z","repository":{"id":30523002,"uuid":"34077510","full_name":"prometheus/graphite_exporter","owner":"prometheus","description":"Server that accepts metrics via the Graphite protocol and exports them as Prometheus metrics","archived":false,"fork":false,"pushed_at":"2024-10-29T09:35:08.000Z","size":5453,"stargazers_count":352,"open_issues_count":11,"forks_count":100,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-10-29T11:44:52.518Z","etag":null,"topics":["graphite","hacktoberfest","metrics","monitoring","observability","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Go","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/prometheus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-16T19:59:48.000Z","updated_at":"2024-10-29T09:34:50.000Z","dependencies_parsed_at":"2024-01-12T18:38:44.076Z","dependency_job_id":"3fec5953-f583-4054-99b2-60968ec2fa74","html_url":"https://github.com/prometheus/graphite_exporter","commit_stats":{"total_commits":271,"total_committers":46,"mean_commits":5.891304347826087,"dds":0.8154981549815499,"last_synced_commit":"cf47e460f839e7e42f1d6016b1300df2e3d15ad9"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus%2Fgraphite_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus%2Fgraphite_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus%2Fgraphite_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prometheus%2Fgraphite_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prometheus","download_url":"https://codeload.github.com/prometheus/graphite_exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247495772,"owners_count":20948106,"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":["graphite","hacktoberfest","metrics","monitoring","observability","prometheus"],"created_at":"2024-08-01T15:02:46.480Z","updated_at":"2025-04-06T14:30:59.806Z","avatar_url":"https://github.com/prometheus.png","language":"Go","funding_links":[],"categories":["Go","HarmonyOS","Exporters"],"sub_categories":["Windows Manager","Other monitoring systems"],"readme":"# Graphite Exporter\n\n[![CircleCI](https://circleci.com/gh/prometheus/graphite_exporter/tree/master.svg?style=shield)][circleci]\n[![Docker Repository on Quay](https://quay.io/repository/prometheus/graphite-exporter/status)][quay]\n[![Docker Pulls](https://img.shields.io/docker/pulls/prom/graphite-exporter.svg?maxAge=604800)][hub]\n\nAn exporter for metrics exported in the [Graphite plaintext\nprotocol](http://graphite.readthedocs.org/en/latest/feeding-carbon.html#the-plaintext-protocol).\nIt accepts data over both TCP and UDP, and transforms and exposes them for\nconsumption by Prometheus.\n\nThis exporter is useful for exporting metrics from existing Graphite setups, as\nwell as for metrics which are not covered by the core Prometheus exporters such\nas the [Node Exporter](https://github.com/prometheus/node_exporter).\n\n## Usage\n\n```sh\nmake\n./graphite_exporter\n```\n\nConfigure existing monitoring to send Graphite plaintext data to port 9109 on UDP or TCP.\nAs a simple demonstration:\n\n```sh\necho \"test_tcp 1234 $(date +%s)\" | nc localhost 9109\necho \"test_udp 1234 $(date +%s)\" | nc -u -w1 localhost 9109\n```\n\nMetrics will be available on [http://localhost:9108/metrics](http://localhost:9108/metrics).\n\nTo avoid using unbounded memory, metrics will be garbage collected five minutes after\nthey are last pushed to. This is configurable with the `--graphite.sample-expiry` flag.\n\n## Graphite Tags\n\nThe graphite_exporter accepts metrics in the [tagged carbon format](https://graphite.readthedocs.io/en/latest/tags.html). In the case where there are valid and invalid tags supplied in one metric, the invalid tags will be dropped and the `graphite_tag_parse_failures` counter will be incremented. The exporter accepts inconsistent label sets, but this may cause issues querying the data in Prometheus.\n\nBy default, labels explicitly specified in configuration take precedence over labels from the metric. To set the label from the metric instead, use [`honor_labels`](https://github.com/prometheus/statsd_exporter/#honor-labels).\n\n\n## Metric Mapping and Configuration\n\n**Please note there has been a breaking change in configuration after version 0.2.0.  The YAML style config from [statsd_exporter](https://github.com/prometheus/statsd_exporter) is now used.  See conversion instructions below**\n\n### YAML Config\n\nThe graphite_exporter can be configured to translate specific dot-separated\ngraphite metrics into labeled Prometheus metrics via YAML configuration file.  This file shares syntax and logic with [statsd_exporter](https://github.com/prometheus/statsd_exporter).  Please follow the statsd_exporter documentation for usage information.  However, graphite_exporter does not support *all* parsing features at this time.  Any feature based on the 'timer_type' option will not function.  Otherwise, regex matching, groups, match/drop behavior, should work as expected.\n\nMetrics that don't match any mapping in the configuration file are translated\ninto Prometheus metrics without any labels and with names in which every\nnon-alphanumeric character except `_` and `:` is replaced with `_`.\n\nIf you have a very large set of metrics you may want to skip the ones that don't\nmatch the mapping configuration. If that is the case you can force this behaviour\nusing the `--graphite.mapping-strict-match` flag, and it will only store those metrics\nyou really want.\n\nAn example mapping configuration:\n\n```yaml\nmappings:\n- match: test.dispatcher.*.*.*\n  name: dispatcher_events_total\n  labels:\n    action: $2\n    job: test_dispatcher\n    outcome: $3\n    processor: $1\n- match: '*.signup.*.*'\n  name: signup_events_total\n  labels:\n    job: ${1}_server\n    outcome: $3\n    provider: $2\n- match: 'servers\\.(.*)\\.networking\\.subnetworks\\.transmissions\\.([a-z0-9-]+)\\.(.*)'\n  match_type: regex\n  name: 'servers_networking_transmissions_${3}'\n  labels: \n    hostname: ${1}\n    device: ${2}\n```\n\nThis would transform these example graphite metrics into Prometheus metrics as\nfollows:\n\n```console\ntest.dispatcher.FooProcessor.send.success\n  =\u003e dispatcher_events_total{processor=\"FooProcessor\", action=\"send\", outcome=\"success\", job=\"test_dispatcher\"}\n\nfoo_product.signup.facebook.failure\n  =\u003e signup_events_total{provider=\"facebook\", outcome=\"failure\", job=\"foo_product_server\"}\n\ntest.web-server.foo.bar\n  =\u003e test_web__server_foo_bar{}\n\nservers.rack-003-server-c4de.networking.subnetworks.transmissions.eth0.failure.mean_rate\n  =\u003e servers_networking_transmissions_failure_mean_rate{device=\"eth0\",hostname=\"rack-003-server-c4de\"}\n```\n\n### Conversion from legacy configuration\n\nIf you have an existing config file using the legacy mapping syntax, you may use [statsd-exporter-convert](https://github.com/bakins/statsd-exporter-convert) to update to the new YAML based syntax.  Here we convert the old example synatx:\n\n```console\n$ go get -u github.com/bakins/statsd-exporter-convert\n\n$ cat example.conf\ntest.dispatcher.*.*.*\nname=\"dispatcher_events_total\"\nprocessor=\"$1\"\naction=\"$2\"\noutcome=\"$3\"\njob=\"test_dispatcher\"\n\n*.signup.*.*\nname=\"signup_events_total\"\nprovider=\"$2\"\noutcome=\"$3\"\njob=\"${1}_server\"\n\n$ statsd-exporter-convert example.conf\nmappings:\n- match: test.dispatcher.*.*.*\n  name: dispatcher_events_total\n  labels:\n    action: $2\n    job: test_dispatcher\n    outcome: $3\n    processor: $1\n- match: '*.signup.*.*'\n  name: signup_events_total\n  labels:\n    job: ${1}_server\n    outcome: $3\n    provider: $2\n```\n\n## Using Docker\n\nYou can deploy this exporter using the [prom/graphite-exporter][hub] Docker image.\n\nFor example:\n\n```bash\ndocker pull prom/graphite-exporter\n\ndocker run -d -p 9108:9108 -p 9109:9109 -p 9109:9109/udp \\\n        -v ${PWD}/graphite_mapping.conf:/tmp/graphite_mapping.conf \\\n        prom/graphite-exporter --graphite.mapping-config=/tmp/graphite_mapping.conf\n```\n\n## **Experimental**: Importing Whisper data\n\nImport data from Graphite using the bundled `getool`.\nSee `getool create-blocks --help` for usage.\n\nTo import long-term data in a reasonable amount of resources, increase the duration per generated TSDB block.\nThe `--block-duration` must be a power of two in hours, e.g. `4h`, `8h`, and so on.\n\nTo merge the data into an existing Prometheus storage directory, start Prometheus with the `--storage.tsdb.allow-overlapping-blocks` flag.\n\n## Incompatibility with Graphite bridge\n\nThis exporter does not work in combination with the [Java client](https://prometheus.github.io/client_java/io/prometheus/client/bridge/Graphite.html) or [Python client](https://github.com/prometheus/client_python#graphite) Graphite bridge.\nIn the transition to the Graphite data model and back, information is lost.\nAdditionally, default metrics conflict between the client libraries and the exporter.\n\nInstead, configure Prometheus to scrape your application directly, without the exporter in the middle.\nFor batch or ephemeral jobs, use the [pushgateway](https://prometheus.io/docs/practices/pushing/) [integration](https://github.com/prometheus/client_python#exporting-to-a-pushgateway).\nIf you absolutely must push, consider [PushProx](https://github.com/prometheus-community/PushProx) or the [Grafana agent](https://github.com/grafana/agent) instead.\n\n## TLS and basic authentication\n\nGraphite Exporter supports TLS and basic authentication. This enables better control of the various HTTP endpoints.\n\nTo use TLS and/or basic authentication, you need to pass a configuration file using the `--web.config.file` parameter. The format of the file is described\n[in the exporter-toolkit repository](https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md).\n\n\n\n[circleci]: https://circleci.com/gh/prometheus/graphite_exporter\n[hub]: https://hub.docker.com/r/prom/graphite-exporter/\n[travis]: https://travis-ci.org/prometheus/graphite_exporter\n[quay]: https://quay.io/repository/prometheus/graphite-exporter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprometheus%2Fgraphite_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprometheus%2Fgraphite_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprometheus%2Fgraphite_exporter/lists"}