{"id":13581825,"url":"https://github.com/mgumz/mtr-exporter","last_synced_at":"2026-02-22T15:40:39.749Z","repository":{"id":38360084,"uuid":"245867819","full_name":"mgumz/mtr-exporter","owner":"mgumz","description":"A Prometheus exporter for mtr metrics","archived":false,"fork":false,"pushed_at":"2026-01-20T21:10:30.000Z","size":298,"stargazers_count":121,"open_issues_count":1,"forks_count":22,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-21T06:48:07.023Z","etag":null,"topics":["metrics","mtr","network-analysis","network-performance","prometheus","prometheus-exporter"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mgumz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-03-08T18:37:56.000Z","updated_at":"2026-01-20T21:10:35.000Z","dependencies_parsed_at":"2024-04-21T10:53:02.803Z","dependency_job_id":"c1e16a2d-b152-4fc1-a08c-8531edf0abb0","html_url":"https://github.com/mgumz/mtr-exporter","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/mgumz/mtr-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgumz%2Fmtr-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgumz%2Fmtr-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgumz%2Fmtr-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgumz%2Fmtr-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgumz","download_url":"https://codeload.github.com/mgumz/mtr-exporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgumz%2Fmtr-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29717737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["metrics","mtr","network-analysis","network-performance","prometheus","prometheus-exporter"],"created_at":"2024-08-01T15:02:15.827Z","updated_at":"2026-02-22T15:40:39.740Z","avatar_url":"https://github.com/mgumz.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# mtr-exporter\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/mgumz/mtr-exporter)](https://goreportcard.com/report/github.com/mgumz/mtr-exporter)\n\n**mtr-exporter** periodically executes [mtr] to a given host and provides the\nmeasured results as [Prometheus] metrics.\n\nUsually, [mtr] is producing the following output:\n\n     HOST: src.example.com       Loss%   Snt   Last   Avg  Best  Wrst StDev\n     1.|-- 127.0.0.1             0.0%     2    0.6   0.6   0.6   0.7   0.1\n     2.|-- 127.0.0.2             0.0%     2    6.1  10.2   6.1  14.3   5.8\n     3.|-- 127.0.0.3             0.0%     2   13.0  12.3  11.6  13.0   1.0\n     4.|-- 127.0.0.4             0.0%     2    7.0   9.1   7.0  11.1   2.9\n     5.|-- 127.0.0.5             0.0%     2   12.5  16.5  12.5  20.6   5.7\n     6.|-- 127.0.0.6             0.0%     2   19.1  18.5  17.9  19.1   0.9\n     7.|-- 127.0.0.7             0.0%     2   18.3  18.2  18.0  18.3   0.2\n     8.|-- 127.0.0.8             0.0%     2   89.9  61.6  33.3  89.9  40.0\n     9.|-- 127.0.0.9             0.0%     2   18.5  18.3  18.1  18.5   0.2\n    10.|-- 127.0.0.10            0.0%     2   20.4  19.8  19.2  20.4   0.8\n\n`mtr-exporter` exposes the measured values like this:\n\n    # mtr run: 2020-03-08T16:37:05.000377Z\n    # cmdline: /usr/local/sbin/mtr -j -c 2 -n example.com\n    mtr_runs_total{bitpattern=\"0x00\",dst=\"example.com\",psize=\"64\",src=\"src,example.com\",tests=\"2\",tos=\"0\"} 13 1583685425000\n    mtr_report_duration_seconds{bitpattern=\"0x00\",dst=\"example.com\",psize=\"64\",src=\"src.example.com\",tests=\"2\",tos=\"0x0\"} 7.179 1583685425000\n    mtr_report_count_hubs{bitpattern=\"0x00\",dst=\"example.com\",psize=\"64\",src=\"src.example.com\",tests=\"2\",tos=\"0x0\"} 10 1583685425000\n    mtr_report_loss{bitpattern=\"0x00\",hop=\"first\",count=\"1\",dst=\"example.com\",host=\"127.0.0.1\",psize=\"64\",src=\"src.example.com\",tests=\"2\",tos=\"0x0\"} 0.000000 1583685425000\n    mtr_report_snt{bitpattern=\"0x00\",hop=\"first\",count=\"1\",dst=\"example.com\",host=\"127.0.0.1\",psize=\"64\",src=\"src.example.com\",tests=\"2\",tos=\"0x0\"} 2 1583685425000\n    mtr_report_last{bitpattern=\"0x00\",hop=\"first\",count=\"1\",dst=\"example.com\",host=\"127.0.0.1\",psize=\"64\",src=\"src.example.com\",tests=\"2\",tos=\"0x0\"} 0.380000 1583685425000\n    mtr_report_avg{bitpattern=\"0x00\",hop=\"first\",count=\"1\",dst=\"example.com\",host=\"127.0.0.1\",psize=\"64\",src=\"src.example.com\",tests=\"2\",tos=\"0x0\"} 0.480000 1583685425000\n    mtr_report_best{bitpattern=\"0x00\",hop=\"first\",count=\"1\",dst=\"example.com\",host=\"127.0.0.1\",psize=\"64\",src=\"src.example.com\",tests=\"2\",tos=\"0x0\"} 0.380000 1583685425000\n    mtr_report_wrst{bitpattern=\"0x00\",hop=\"first\",count=\"1\",dst=\"example.com\",host=\"127.0.0.1\",psize=\"64\",src=\"src.example.com\",tests=\"2\",tos=\"0x0\"} 0.570000 1583685425000\n    mtr_report_stdev{bitpattern=\"0x00\",hop=\"first\",count=\"1\",dst=\"example.com\",host=\"127.0.0.1\",psize=\"64\",src=\"src.example.com\",tests=\"2\",tos=\"0x0\"} 0.130000 1583685425000\n\nEach hop gets a label `\"hop\"=\"first\"`, `\"hop\"=\"last\"`, `\"hop\"=\"first_last\"` or\n`\"hop\"=\"intermediate\"`, depending where on the path to the destination the hop\nis.\n\nLegacy: the last hop in the list of tested hosts contains the label `\"last\"=\"true\"`.\nUse `hop=~\".*last\"` in your Prometheus queries to achieve the same.\n\n`mtr_report_path_id` is a metric to allow detecting path changes along the\nroute between `src` and `dst` hosts. Technically, it is the result of a hash\nfunction (see [Blake2b]) of the concatenated hops as measured. In addition to\nthe metric `mtr_report_path_id`, the label `path_id` is available on most\nmetrics. One can use a prometheus query such as this to detect changes:\n\n```prometheus\nchanges(max by(dst) (mtr_report_path_id{hop=\"last\"})[5m:1m])\n```\n\nSuch data can then visualized with [Grafana]:\n\n![MTR results in Grafana](./media/screenshot-2026-01-24-fs8.png)\n\nSee [helpers/grafana-dashboard.json](helpers/grafana-dashboard.json) as an\nexample of a Dashboard ready for [Grafana].\n\n## Usage\n\n    $\u003e mtr-exporter [FLAGS] -- [MTR-FLAGS]\n\n    FLAGS:\n    -bind       \u003cbind-address\u003e\n                bind address (default \":8080\")\n    -flag.deprecatedMetrics\n                render deprecated metrics (default: false)\n                helps with transition time until deprecated metrics are gone\n    -h\n                show help\n    -jobs       \u003cpath-to-jobsfile\u003e\n                file describing multiple mtr-jobs. syntax is given below.\n    -label      \u003cjob-label\u003e\n                use \u003cjob-label\u003e in prometheus-metrics (default: \"mtr-exporter-cli\")\n    -mtr        \u003cpath-to-binary\u003e\n                path to mtr binary (default: \"mtr\")\n    -schedule   \u003cschedule\u003e\n                schedule at which often mtr is launched (default: \"@every 60s\")\n                examples:\n                   @every \u003cdur\u003e  - example \"@every 60s\"\n                   @hourly       - run once per hour\n                   10 * * * *    - execute 10 minutes after the full hour\n                see https://en.wikipedia.org/wiki/Cron\n    -tslogs\n                use timestamps in logs\n    -watch-jobs \u003cschedule\u003e\n                periodically watch the file defined via -jobs (default: \"\")\n                if it has changed stop previously running mtr-jobs and apply\n                all jobs defined in -jobs.\n    -version\n                show version\n    MTR-FLAGS:\n            see \"man mtr\" for valid flags to mtr.\n\nSince [mtr] itself supports the environment variable `MTR_OPTIONS`, you can\nalso use it to specify common options for all the launched [mtr] instances\n\nAt `/metrics` the measured values of the last run are exposed.\n\n### Examples\n\n    $\u003e mtr-exporter -- example.com\n    # probe every minute \"example.com\"\n\n    $\u003e mtr-exporter -- -n example.com\n    # probe every minute \"example.com\", do not resolve DNS\n\n    $\u003e mtr-exporter -schedule \"@every 30s\" -- -G 1 -m 3 -I ven3 -n example.com\n    # probe every 30s \"example.com\", wait 1s for response, try a max of 3 hops,\n    # use interface \"ven3\", do not resolve DNS.\n\n### Jobs-File Syntax\n\n    # comment lines start with '#' are ignored\n    # empty lines are ignored as well\n    label -- \u003cschedule\u003e -- mtr-flags\n\n`\u003cschedule\u003e` - a schedule expression which follows one of\n\n* `* * * * *` - a cron expression, see https://en.wikipedia.org/wiki/Cron\n* `@hourly` | `@daily` etc - see https://pkg.go.dev/github.com/robfig/cron/v3#hdr-Predefined_schedules\n* `@every \u003cduration\u003e` - execute [mtr] in an interval\n\n* `@every \u003cduration\u003e unless finished`\n\nExample:\n\n    quad9       -- @every 120s -- -I ven1 -n 9.9.9.9\n    example.com -- @every 45s  -- -I ven2 -n example.com\n\n\n## Requirements\n\nRuntime:\n\n* mtr-0.89 and newer (added --json support)\n\nBuild:\n\n* golang-1.21 and newer\n\n## Building\n\n    $\u003e git clone https://github.com/mgumz/mtr-exporter\n    $\u003e cd mtr-exporter\n    $\u003e make\n\nOne-off building and \"installation\":\n\n    $\u003e go install github.com/mgumz/mtr-exporter/cmd/mtr-exporter@latest\n\n## OCI Images\n\nOCI images for `linux/amd64` platform are available for recent releases under\nhttps://github.com/mgumz/mtr-exporter/pkgs/container/mtr-exporter\n\nMake sure to preserve the ENTRY command to benefit from the default\n[krallin/tini](s://github.com/krallin/tini) zombie. In kubernetes, this\ntranslates into omitting the `command` and only specifying `args` for passing\nmtr-exporter\n```yaml\n      containers:\n        - name: mtr-prometheus-collector\n          image: ghcr.io/mgumz/mtr-exporter:0.4.0\n\n          # Note: We need to override the container entry point which is an\n          # array ENTRYPOINT [\"/sbin/tini\", \"--\", \"/usr/bin/mtr-exporter\"]\n          # Only the fist element end up in the container `command`, and the two\n          # others end up in the default `args` value\n          # See sources at https://github.com/mgumz/mtr-exporter/blob/fd2834d5269afebfc0cd2c269a8bb26d8d816a0c/Containerfile#L29C1-L29C57\n          command:\n            # use tini to automatically reap zombie mtr and mtr-packet\n            # processes. See\n            # https://github.com/mgumz/mtr-exporter/issues/24#issuecomment-2581077241\n            - \"/sbin/tini\"\n            - \"--\"\n            - \"/usr/bin/mtr-exporter\"\n            # default schedule is every 60 seconds\n            - \"-schedule\"\n            - \"@every 5m\"\n            - \"--\"\n            - \"example.com\"\n```\n\n\n## License\n\nsee LICENSE file\n\n## Author(s)\n\n* Mathias Gumz \u003cmg@2hoch5.com\u003e\n\n[mtr]: https://www.bitwizard.nl/mtr/index.html\n[Prometheus]: https://prometheus.io\n[Grafana]: https://grafana.com\n[Blake2b]: https://datatracker.ietf.org/doc/html/rfc7693.html\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgumz%2Fmtr-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgumz%2Fmtr-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgumz%2Fmtr-exporter/lists"}