title: "t.data.data is undefined" in grafana
body: <p>I'm new to micrometer, prometheus and grafana. I'm trying to run my first example with these three things working together. But I'm having a hard time figuring out what I'm doing wrong.</p>
  
  <p>I'm using micrometer's API to create a <code>PrometheusMeterRegistry</code> like this:</p>
  
  <pre><code>new PrometheusMeterRegistry(new PrometheusConfig() {
          @Override
          public Duration step() {
              return Duration.ofSeconds(10);
          }
  
          @Override
          @Nullable
          public String get(String k) {
              return null;
          }
      });
  </code></pre>
  
  <p>And I'm creating a <code>HttpServer</code> as described here using the following code:</p>
  
  <pre><code>try {
              HttpServer server = HttpServer.create(new InetSocketAddress(8080), 0);
              server.createContext("/prometheus", httpExchange -&gt; {
                  String response = prometheusMeterRegistry.scrape();
                  httpExchange.sendResponseHeaders(200, response.getBytes().length);
                  try (OutputStream os = httpExchange.getResponseBody()) {
                      os.write(response.getBytes());
                  }
              });
  
              new Thread(server::start).start();
      } catch (IOException e) {
          throw new RuntimeException(e);
      }
  </code></pre>
  
  <p>I configured Prometheus as my data-source in grafana and set the URL to <code>http://localhost:8080/prometheus</code>. But when I try creating a new dashboard and add a graph to it, I get a red exclamation mark saying <code>t.data.data is undefined</code>. And because of this I'm not able to view the graphs. The complete stack-trace is as follows:</p>
  
  <pre><code>kr&lt;/t.prototype.transform@http://localhost:3000/public/build/app.dfabdd44b3be44288eac.js:22:723420
  jr&lt;/t.prototype.query/&lt;/&lt;@http://localhost:3000/public/build/app.dfabdd44b3be44288eac.js:22:736135
  qt@http://localhost:3000/public/build/vendor.dfabdd44b3be44288eac.js:9:5239
  Wa@http://localhost:3000/public/build/vendor.dfabdd44b3be44288eac.js:9:40274
  jr&lt;/t.prototype.query/&lt;@http://localhost:3000/public/build/app.dfabdd44b3be44288eac.js:22:735858
  c/&lt;/&lt;@http://localhost:3000/public/build/vendor.dfabdd44b3be44288eac.js:130:92198
  c/&lt;@http://localhost:3000/public/build/vendor.dfabdd44b3be44288eac.js:130:92043
  $digest@http://localhost:3000/public/build/vendor.dfabdd44b3be44288eac.js:130:97575
  $apply@http://localhost:3000/public/build/vendor.dfabdd44b3be44288eac.js:130:99590
  $applyAsync/r&lt;@http://localhost:3000/public/build/vendor.dfabdd44b3be44288eac.js:130:99735
  h@http://localhost:3000/public/build/vendor.dfabdd44b3be44288eac.js:130:33036
  ln/this.$get&lt;/&lt;/i.defer/n&lt;@http://localhost:3000/public/build/vendor.dfabdd44b3be44288eac.js:130:34396
  </code></pre>
  
  <p>The following is the screenshot of the error in grafana that I'm gettng:
  <a href="https://i.stack.imgur.com/ZL5jl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZL5jl.png" alt="enter image description here"></a></p>
  
  <p>Any suggestions what I might be missing?</p>
  
  <p>Note: I can see timer getting published on native prometheus using URL <code>localhost:8080/prometheus</code>.</p>