Giter Club home page Giter Club logo

graphql_exporter's People

Contributors

lucas-kohorst avatar ricardbejarano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

graphql_exporter's Issues

Unable to get the list of values

Hi, i am using Graphql exporter, I am unable to get all the responses into prometheus. example response from graphql:

{
"data": {
"data": [
{
"id": 1,
"name": "test",
"template": 1,
"nodes": [
{
"templateNode": {
"name": "EB",
"equipmentType": {
"name": "5216"
}
}
},
{
"templateNode": {
"name": "CT",
"equipmentType": {
"name": "CT"
}
}
},
{
"templateNode": {
"name": "RU",
"equipmentType": {
"name": "RRUS_11_B4"
}
}
},
{
"templateNode": {
"name": "RU-B7",
"equipmentType": {
"name": "RRUS_11_B7"
}
}
},
{
"templateNode": {
"name": "E500-1",
"equipmentType": {
"name": "E500"
}
}
},
{
"templateNode": {
"name": "UE-1",
"equipmentType": {
"name": "UE_QC_5605"
}
}
}
]
}
]
}
}

When I use promql query "query_data_nodes_templateNode_name" the response is:
query_data_nodes_templateNode_name{data="0", endpoint="http://127.0.0.1:8080/graphql", instance="127.0.0.1:9199", job="graphql-exporter", nodes="0", value="EB"}

As you can see in the response there is only EB returned but not CT and RU.

How to solve this issue? any suggestions?

Trying to install on bash

upon make command,

find . -name '*.go' -exec gofmt -e -s -w {} +
CGO_ENABLED=0 go build -o bin/graphql_exporter
query.go:14:2: cannot find package "github.com/prometheus/client_golang/prometheus" in any of:
/usr/lib/go-1.10/src/github.com/prometheus/client_golang/prometheus (from $GOROOT)
/root/go/src/github.com/prometheus/client_golang/prometheus (from $GOPATH)
main.go:9:2: cannot find package "github.com/prometheus/client_golang/prometheus/promhttp" in any of:
/usr/lib/go-1.10/src/github.com/prometheus/client_golang/prometheus/promhttp (from $GOROOT)
/root/go/src/github.com/prometheus/client_golang/prometheus/promhttp (from $GOPATH)
query.go:16:2: cannot find package "github.com/ricardbejarano/go-graphql" in any of:
/usr/lib/go-1.10/src/github.com/ricardbejarano/go-graphql (from $GOROOT)
/root/go/src/github.com/ricardbejarano/go-graphql (from $GOPATH)
main.go:10:2: cannot find package "github.com/usewormhol/env" in any of:
/usr/lib/go-1.10/src/github.com/usewormhol/env (from $GOROOT)
/root/go/src/github.com/usewormhol/env (from $GOPATH)
Makefile:7: recipe for target 'build' failed
make: *** [build] Error 1

any ideas?

Query endpoint always returns a gauge value of `1`

Hi, I've got this exporter successfully querying against my GridQL endpoint, and it is returning the expected values, however, they arrive as a label rather than a value, and the metric value is always 1:

curl -H 'Authorization: Token XXX' \
'https://my.server.com:9199/query?endpoint=https://my.api/v2/api/&query=<url_encoded_query>'
# HELP query_user_accounts_apps_logs_entries_data
# TYPE query_user_accounts_apps_logs_entries_data gauge
query_user_accounts_apps_logs_entries_data{accounts="0",apps="0",endpoint="https://my.api/v2/api/",entries="0",value="{\"data\": {\"latency\": 6226}, ...}}"} 1

This exporter seems to return the query results under the value label, but it doesn't present them as an actual metric value per the Prometheus format: metric_name{metric_label1="abc",metric_label2="zxc"} 12345.34

I was able to use Prometheus' metric_relabel_configs to extract the latency from inside the value label and put it into its own label, so now it looks like this in Prometheus:

query_user_accounts_apps_logs_entries_data{instance="localhost:9199", job="graphql_exporter", latency="6226", value="{"data": {"latency": 6226,...}}"}

However, I want to get the latency value into proper Prometheus format like so:

query_user_accounts_apps_logs_entries_data{instance="localhost:9199", job="graphql_exporter"} 6226

Currently every metric value is just 1 so there's nothing useful to graph in Grafana. Am I missing something? Or is there a bug here? How do I get all the values out of the value label and into actual metric values per Prometheus format? Thanks for your help!

error: queryHandler: no querying endpoint provided

Hi,
So I'm following the example listed as part of the prometheus.yml configuration.

{
                  viewer {
                    zones(filter: {zoneTag: "abc123"}) {
                      httpRequests1mGroups(limit: 1, filter: { datetime_gt: "2021-04-28T13:00:00Z", datetime_lt: "2021-04-28T14:01:00Z"}) {
                        dimensions {
                          datetime
                        }
                        sum {
                          bytes
                        }
                      }
                    }
                  }
                }

Executing the above on a graphQL application, it works successfully and returns correct values, however as part of the prometheus configuration I'm getting error on graphql_exporter - error: queryHandler: no querying endpoint provided>

Can you kindly indicate me if i'm missing something

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.