0

I'm pushing custom metrics to IBM monitoring using the REST API. That seems to work because querying the data returns it (see below). However, whatever metric I try to configure in Grafana, the visualization always comes up empty with "no datapoints".

How should I address the custom metric in Grafana?

POST https://metrics.ng.bluemix.net/v1/metrics

[
    {
        "name":"test_metric",
        "value":80,
        "timestamp":1541866045
    }
]

GET https://metrics.ng.bluemix.net/v1/metrics?target=*&from=1541865900&to=now

[
  {
    "target": "test_metric",
    "datapoints": [
        [
            100,
            1541865930
        ],
        [
            30,
            1541865960
        ],
        [
            30,
            1541865990
        ],
        [
            80,
            1541866020
        ],
        [
            null,
            1541866050
        ],
        [
            null,
            1541866080
        ]
   ]
  }
]
oɔɯǝɹ
  • 7,219
  • 7
  • 58
  • 69
Oren
  • 1,796
  • 1
  • 15
  • 17
  • Hope you have configured a metric query in Grafana. If not follow the instructions mentioned [here](https://console.bluemix.net/docs/services/cloud-monitoring/grafana/define_query.html#define_query) – Vidyasagar Machupalli Nov 13 '18 at 09:46

1 Answers1

0

Apparently I had to add the header X-Auth-Scope-Id to make sure that Grafana was looking at the right datasource. Although it's technically an optional header (and stated as optional in the documentation), if you don't specify it then IBM's default settings in its hosted Grafana will not find the data, unless you explicitly change the view to the "account" scope. Thanks to everyone who took at look at this.

Oren
  • 1,796
  • 1
  • 15
  • 17