func (engine *MetricsEngine) publishMetrics() {
	go func() {
		// Because we are using the DefaultRegisterer in Prometheus, we can use
		// the promhttp.Handler() function. In future cases for custom registers,
		// we can use promhttp.HandlerFor(customRegisterer, promhttp.HandlerOpts{})
		http.Handle("/metrics", promhttp.Handler())
		err := http.ListenAndServe(fmt.Sprintf(":%d", config.AgentPrometheusExpositionPort), nil)
		if err != nil {
			seelog.Errorf("Error publishing metrics: %s", err.Error())
		}
	}()
}
func (engine *MetricsEngine) publishMetrics() {
	go func() {
		// Because we are using the DefaultRegisterer in Prometheus, we can use
		// the promhttp.Handler() function. In future cases for custom registers,
		// we can use promhttp.HandlerFor(customRegisterer, promhttp.HandlerOpts{})
		http.Handle("/metrics", promhttp.Handler())
		err := http.ListenAndServe(fmt.Sprintf(":%d", config.AgentPrometheusExpositionPort), nil)
		if err != nil {
			seelog.Errorf("Error publishing metrics: %s", err.Error())
		}
	}()
}
func ( engine * MetricsEngine ) publishMetrics ( ) { go func ( ) { // Because we are using the DefaultRegisterer in Prometheus, we can use // the promhttp.Handler() function. In future cases for custom registers, // we can use promhttp.HandlerFor(customRegisterer, promhttp.HandlerOpts{}) http . Handle ( " " , promhttp . Handler ( ) ) err := http . ListenAndServe ( fmt . Sprintf ( " " , config . AgentPrometheusExpositionPort ) , nil ) if err != nil { seelog . Errorf ( " " , err . Error ( ) ) } } ( ) }
// Function that exposes all Agent Metrics on a given port.
Function that exposes all Agent Metrics on a given port .