 buildGlobalKey = (key)-> "#{name}.global.#{key}"
 
 counters = {}
+gauges = {}
 
 destructors = []
 

	inc : (key, sampleRate = 1)->
		statsd.increment buildKey(key), sampleRate
		if !counters[key]
			console.log("No Metric")
			counters[key] = new prom.Counter({
		  		name: key,
				help: key #https://prometheus.io/docs/instrumenting/writing_exporters/#help-strings this is probably wrong
				labelNames: ['name','host']
			})
		counters[key].inc({name: name, host: hostname})


	gauge : (key, value, sampleRate = 1)->
		statsd.gauge buildKey(key), value, sampleRate
		if !gauges[key]
			gauges[key] = new prom.Gauge({
		  		name: key,
				help: key, 
				labelNames: ['name','host']
			})
		gauges[key].set({name: name, host: hostname},value)

	globalGauge: (key, value, sampleRate = 1)->
		statsd.gauge buildGlobalKey(key), value, sampleRate
		if !gauges[key]
			gauges[key] = new prom.Gauge({
		  		name: key,
				help: key, 
				labelNames: ['name','host']
			})
		gauges[key].set({name: name},value)

	mongodb: require "./mongodb"
	http: require "./http"
