Fixed Backward Compatibility

This commit is contained in:
Mario
2023-03-31 22:06:08 +02:00
parent f50f5185df
commit 97ab2f6e95

View File

@ -87,11 +87,13 @@ func (b *Builder) Close() error {
func (b *Builder) Run() error { func (b *Builder) Run() error {
// Init Prometheus openmetrics // Init Prometheus openmetrics
go func() { go func() {
if (b.beelzebubCoreConfigurations.Core.Prometheus != parser.Prometheus{}) {
http.Handle(b.beelzebubCoreConfigurations.Core.Prometheus.Path, promhttp.Handler()) http.Handle(b.beelzebubCoreConfigurations.Core.Prometheus.Path, promhttp.Handler())
if err := http.ListenAndServe(b.beelzebubCoreConfigurations.Core.Prometheus.Port, nil); err != nil { if err := http.ListenAndServe(b.beelzebubCoreConfigurations.Core.Prometheus.Port, nil); err != nil {
log.Fatalf("Error init Prometheus: %s", err.Error()) log.Fatalf("Error init Prometheus: %s", err.Error())
} }
}
}() }()
// Init Protocol strategies // Init Protocol strategies