Skip to content

Commit

Permalink
Merge pull request #15 'feature/expose-schema-through-content-type'
Browse files Browse the repository at this point in the history
  • Loading branch information
bernerdschaefer committed Apr 29, 2013
2 parents 4c1c13d + f60c783 commit 9ba7cdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 3 additions & 5 deletions prometheus/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ const (

// The format of the exported data. This will match this library's version,
// which subscribes to the Semantic Versioning scheme.
APIVersion = "0.0.1"
APIVersion = "0.0.2"

// When reporting telemetric data over the HTTP web services interface, a web
// services interface shall include this header along with APIVersion as its
// value.
ProtocolVersionHeader = "X-Prometheus-API-Version"
// The content type and schema information set on telemetry data responses.
TelemetryContentType = `application/json; schema="prometheus/telemetry"; version=` + APIVersion

// The customary web services endpoint on which telemetric data is exposed.
ExpositionResource = "/metrics.json"
Expand Down
3 changes: 1 addition & 2 deletions prometheus/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ 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, TelemetryContentType)

writer := decorateWriter(r, w)

Expand Down

0 comments on commit 9ba7cdf

Please sign in to comment.