Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce metrics from json pathes #2

Open
martin-huber opened this issue May 19, 2022 · 0 comments
Open

Produce metrics from json pathes #2

martin-huber opened this issue May 19, 2022 · 0 comments

Comments

@martin-huber
Copy link
Member

martin-huber commented May 19, 2022

probe_httpjson_gitgroups_id{groupIndex="0"} 189
probe_httpjson_gitgroups_members{groupIndex="0", membersIndex="0", name="Hannes"} 1
probe_httpjson_gitgroups_members_age{groupIndex="0", membersIndex="0"} 37
probe_httpjson_gitgroups_members{groupIndex="0", membersIndex="1", name="Joseph" lastname="Vilimas"} 1
probe_httpjson_gitgroups_members_age{groupIndex="0", membersIndex="1"} 33
probe_httpjson_gitgroups_members{groupIndex="1", membersIndex="3", name="Martin"} 1
probe_httpjson_gitgroups_members_age{groupIndex="1", membersIndex="3"} 55

For an API like:

[
	{
	  id: 1,
	  members: [
		{ name: "Hannes", age: 37},
		{ name: "Joseph", age: 33}
	  ]
	},
	{
	  id: 2,
	  members: [
		{ name: "Hannes", age: 37},
		{ name: "Joseph", age: 33},
		{ name: "Martin", age: 55}
	  ]
	}
]
probe_probername_configuredPrefix_dynamicGeneratedPathes
probe_httpjson_gitgroups_....

Prometheus Config:

scrape_configs:
  - job_name: cloudsigma_snapshots_json
    metrics_path: /probe
    params:
	  target: http://api.com/api/json
	  module: [json]
	  //jsonPath: [objects[.*].allocated_size, objects[.*].drive.uuid]
	static_configs:
	 - targets:
	   - http://blackbox-export-url:9115

Blackbox Exporter Config:

modules:
   json:
      prober: httpjson
jporzelt pushed a commit that referenced this issue May 19, 2022
jporzelt pushed a commit that referenced this issue May 20, 2022
jporzelt pushed a commit that referenced this issue May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant