{"id":18639004,"url":"https://github.com/tolleiv/json-exporter","last_synced_at":"2025-04-11T10:32:20.899Z","repository":{"id":57695033,"uuid":"94545536","full_name":"tolleiv/json-exporter","owner":"tolleiv","description":"Prometheus exporter which fetches JSON from a URL and exports one of the values as gauge metrics","archived":false,"fork":false,"pushed_at":"2019-03-16T08:35:44.000Z","size":8,"stargazers_count":24,"open_issues_count":6,"forks_count":18,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T17:05:52.818Z","etag":null,"topics":["docker","jsonpath","metrics","prometheus","prometheus-exporter"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tolleiv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-16T13:17:15.000Z","updated_at":"2023-11-26T21:42:33.000Z","dependencies_parsed_at":"2022-09-26T21:01:36.384Z","dependency_job_id":null,"html_url":"https://github.com/tolleiv/json-exporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolleiv%2Fjson-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolleiv%2Fjson-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolleiv%2Fjson-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolleiv%2Fjson-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tolleiv","download_url":"https://codeload.github.com/tolleiv/json-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223466502,"owners_count":17149770,"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":["docker","jsonpath","metrics","prometheus","prometheus-exporter"],"created_at":"2024-11-07T05:44:44.510Z","updated_at":"2024-11-07T05:44:45.112Z","avatar_url":"https://github.com/tolleiv.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Json Exporter\n![TravisCI build status](https://travis-ci.org/tolleiv/json-exporter.svg?branch=master)\n[![Docker Build Statu](https://img.shields.io/docker/build/tolleiv/json-exporter.svg)](https://hub.docker.com/r/tolleiv/json-exporter/)\n\nThis Prometheus exporter operates similar to the Blackbox exporters. It downloads a JSON file and provides a numerical gauge value from within that file.\nWhich value to pick is defined through JsonPath.\n\n## Parameters\n\n - `target`: URL / Json-file to download\n - `jsonpath`: the field name to read the value from, this follows the syntax provided by [oliveagle/jsonpath](https://github.com/oliveagle/jsonpath)\n\n## Docker usage\n\n    docker build -t json_exporter .\n    docker -d -p 9116:9116 --name json_exporter json_exporter\n   \nThe related metrics can then be found under:\n   \n    http://localhost:9116/probe?target=http://validate.jsontest.com/?json=%7B%22key%22:%22value%22%7D\u0026jsonpath=$.parse_time_nanoseconds\n\n## Prometheus Configuration\n\nThe json exporter needs to be passed the target and the json as a parameter, this can be\ndone with relabelling.\n\nExample config:\n```yml\nscrape_configs:\n  - job_name: 'json'\n    metrics_path: /probe\n    params:\n      jsonpath: [$.parse_time_nanoseconds] # Look for the nanoseconds field\n    static_configs:\n      - targets:\n        - http://validate.jsontest.com/?json=%7B%22key%22:%22value%22%7D\n    relabel_configs:\n      - source_labels: [__address__]\n        target_label: __param_target\n      - source_labels: [__param_target]\n        target_label: instance\n      - target_label: __address__\n        replacement: 127.0.0.1:9116  # Json exporter.\n    metric_relabel_configs:\n      - source_labels: value\n        target_label: parse_time\n\n```\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolleiv%2Fjson-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftolleiv%2Fjson-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolleiv%2Fjson-exporter/lists"}