Created
April 25, 2013 14:34
-
-
Save bernerdschaefer/5460170 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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