prometheus-community / json_exporter

A prometheus exporter which scrapes remote JSON by JSONPath
Apache License 2.0
641 stars 197 forks source link

Code 200 but no response. #220

Open diogocardoso28 opened 1 year ago

diogocardoso28 commented 1 year ago

I get no erros but I also get no output:

Here's the JSON:

{
    "@odata.context": "/redfish/v1/$metadata#Thermal.Thermal",
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Thermal",
    "@odata.type": "#Thermal.v1_4_0.Thermal",
    "Description": "Represents the properties for Temperature and Cooling"
}

Here's the config.yml:

http_client_config:
  tls_config:
    insecure_skip_verify: true
modules:
  teste:
    metrics:
      - name: example_global_value
        path: "{ .Description }"
        help: Example of a top-level global value scrape in the json
        labels:
          environment: beta

And here's my query: image

Also nothing shows up on prometheus or on the containers logs.

I'm I missing something?

amirnh2 commented 1 year ago

For me, the problem was using an older image of json exporter in the docker compose file, instead of using the "latest" label. The example I had found was for an older version, the entirety of which I copied without modification. Changing the label to latest fixed the issue.