Skip to content

Instantly share code, notes, and snippets.

@bernerdschaefer
Created April 25, 2013 14:34
Show Gist options
  • Save bernerdschaefer/5460170 to your computer and use it in GitHub Desktop.
Save bernerdschaefer/5460170 to your computer and use it in GitHub Desktop.
diff --git a/prometheus/registry.go b/prometheus/registry.go
index ebe9871..32b4192 100644
--- a/prometheus/registry.go
+++ b/prometheus/registry.go
@@ -14,6 +14,7 @@ import (
"fmt"
"io"
"log"
+ "mime"
"net/http"
"sort"
"strings"
@@ -241,7 +242,13 @@ func (registry registry) Handler() http.HandlerFunc {
if strings.HasSuffix(url.Path, jsonSuffix) {
header := w.Header()
header.Set(ProtocolVersionHeader, APIVersion)
- header.Set(contentTypeHeader, jsonContentType)
+ header.Set(contentTypeHeader, mime.FormatMediaType(
+ "application/json",
+ map[string]string{
+ "schema": "prometheus/telemetry",
+ "version": APIVersion,
+ },
+ ))
writer := decorateWriter(r, w)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment