Commit Graph

6 Commits

Author SHA1 Message Date
Julius Volz bb957bc145 Change internal metric name label to __name__.
This also adds a check that forbids any user-supplied metrics to start
with the reserved label name prefix "__".

Change-Id: I2fe94c740b685ad05c4c670613cf2af7b9e1c1c0
2014-03-14 12:28:25 +01:00
Bernerd Schaefer a9b3602cea Register copies the provided baseLabels
This ensures that you can pass the same base label set into multiple
Register() calls, e.g.:

    labels := map[string]string{"key": "value"}
    prometheus.Register("metric_1", "", labels, ...)
    prometheus.Register("metric_2", "", labels, ...)

Change-Id: I951e5c2ed7844c74eb3716d1bf07126ce558f266
2013-09-11 17:38:00 +02:00
Matt T. Proud 4956aea5ac Protocol Buffer negotiation support in handler. 2013-07-01 17:14:58 +02:00
Bernerd Schaefer 71dd60e431 Registry and Metrics implement json.Marshaler
* Drop `AsMarshallable()` from the Metric interface. Use
  `json.Marshaler` and `MarshalJSON()`, and leverage JSON struct tags
  where possible.

* Add `MarshalJSON()` to Registry and remove `dumpToWriter`, which
  makes the registry handler much simpler.

In addition to simplifying some of the marshalling behavior, this also
has the nice side effect of cutting down the number of
`map[string]interface{}` instances.
2013-04-19 15:07:24 +02:00
Bernerd Schaefer 3433b798b3 Use raw string literals in tests 2013-04-19 15:04:07 +02:00
Matt T. Proud f320d28a6c Rearrange file and package per convention.
WIP - Please review but do not merge.
2013-04-04 15:27:09 +02:00