SEBA-794:update-exporter-for-promhttp
Change-Id: Ia16a5efc484dc27821873e09106bf3770d2b74fd
diff --git a/Gopkg.lock b/Gopkg.lock
index 1f31994..5d9ed06 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -10,12 +10,12 @@
version = "v1.4.0"
[[projects]]
- digest = "1:2ec153af6a806c3d63d4299f2549bcb29d75d9703097341be309a46db3481488"
+ digest = "1:b449dbaada891dc97f016bc3519bb1af0e1a4296828f7a560a0ba47ea75f20bb"
name = "github.com/Shopify/sarama"
packages = ["."]
pruneopts = "UT"
- revision = "ea9ab1c316850bee881a07bb2555ee8a685cd4b6"
- version = "v1.22.1"
+ revision = "dde3ddda8b4b3a594690086725799ab1573bb895"
+ version = "v1.23.0"
[[projects]]
digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d"
@@ -38,8 +38,8 @@
name = "github.com/eapache/go-resiliency"
packages = ["breaker"]
pruneopts = "UT"
- revision = "ea41b0fad31007accc7f806884dcdf3da98b79ce"
- version = "v1.1.0"
+ revision = "5efd2ed019fd331ec2defc6f3bd98882f1e3e636"
+ version = "v1.2.0"
[[projects]]
branch = "master"
@@ -66,12 +66,12 @@
revision = "f62e125fcbfec116f56051e523699d5cce1d33f8"
[[projects]]
- digest = "1:318f1c959a8a740366fce4b1e1eb2fd914036b4af58fbd0a003349b305f118ad"
+ digest = "1:573ca21d3669500ff845bdebee890eb7fc7f0f50c59f2132f2a0c6b03d85086a"
name = "github.com/golang/protobuf"
packages = ["proto"]
pruneopts = "UT"
- revision = "b5d812f8a3706043e23a9cd5babf2e5423744d30"
- version = "v1.3.1"
+ revision = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7"
+ version = "v1.3.2"
[[projects]]
digest = "1:e4f5819333ac698d294fe04dbf640f84719658d5c7ce195b10060cc37292ce79"
@@ -82,6 +82,25 @@
version = "v0.0.1"
[[projects]]
+ digest = "1:f14364057165381ea296e49f8870a9ffce2b8a95e34d6ae06c759106aaef428c"
+ name = "github.com/hashicorp/go-uuid"
+ packages = ["."]
+ pruneopts = "UT"
+ revision = "4f571afc59f3043a65f8fe6bf46d887b10a01d43"
+ version = "v1.0.1"
+
+[[projects]]
+ digest = "1:ae221758bdddd57f5c76f4ee5e4110af32ee62583c46299094697f8f127e63da"
+ name = "github.com/jcmturner/gofork"
+ packages = [
+ "encoding/asn1",
+ "x/crypto/pbkdf2",
+ ]
+ pruneopts = "UT"
+ revision = "dc7c13fece037a4a36e2b3c69db4991498d30692"
+ version = "v1.0.0"
+
+[[projects]]
digest = "1:31e761d97c76151dde79e9d28964a812c46efc5baee4085b86f68f0c654450de"
name = "github.com/konsorten/go-windows-terminal-sequences"
packages = ["."]
@@ -98,26 +117,27 @@
version = "v1.0.1"
[[projects]]
- digest = "1:259f9b7645983a7a823318d78aa96dec68af8891f706493ac1ec04d819cb977c"
+ digest = "1:f690a0a27cefae695fa9587aa3ed23652e593be1d98b35f8184d10bccec30444"
name = "github.com/pierrec/lz4"
packages = [
".",
"internal/xxh32",
]
pruneopts = "UT"
- revision = "d705d4371bfccdf47f10e45584e896026c83616f"
- version = "v2.2.3"
+ revision = "057d66e894a4e55853274a3bbbf7de02ba639e43"
+ version = "v2.2.4"
[[projects]]
- digest = "1:641a6f02ac68db91eee65eed28a23630b215aea79e39b3dbcfa0fdbb19cd11de"
+ digest = "1:eb04f69c8991e52eff33c428bd729e04208bf03235be88e4df0d88497c6861b9"
name = "github.com/prometheus/client_golang"
packages = [
"prometheus",
"prometheus/internal",
+ "prometheus/promhttp",
]
pruneopts = "UT"
- revision = "2641b987480bca71fb39738eb8c8b0d577cb1d76"
- version = "v0.9.4"
+ revision = "4ab88e80c249ed361d3299e2930427d9ac43ef8d"
+ version = "v1.0.0"
[[projects]]
branch = "master"
@@ -136,27 +156,27 @@
"model",
]
pruneopts = "UT"
- revision = "17f5ca1748182ddf24fc33a5a7caaaf790a52fcc"
- version = "v0.4.1"
+ revision = "31bed53e4047fd6c510e43a941f90cb31be0972a"
+ version = "v0.6.0"
[[projects]]
- digest = "1:403b810b43500b5b0a9a24a47347e31dc2783ccae8cf97c891b46f5b0496fa1a"
+ digest = "1:366f5aa02ff6c1e2eccce9ca03a22a6d983da89eecff8a89965401764534eb7c"
name = "github.com/prometheus/procfs"
packages = [
".",
"internal/fs",
]
pruneopts = "UT"
- revision = "833678b5bb319f2d20a475cb165c6cc59c2cc77c"
- version = "v0.0.2"
+ revision = "3f98efb27840a48a7a2898ec80be07674d19f9c8"
+ version = "v0.0.3"
[[projects]]
branch = "master"
- digest = "1:d38f81081a389f1466ec98192cf9115a82158854d6f01e1c23e2e7554b97db71"
+ digest = "1:267844804416a11470a2fbf68549b98959e22d77e0921e2349276958477f08a3"
name = "github.com/rcrowley/go-metrics"
packages = ["."]
pruneopts = "UT"
- revision = "3113b8401b8a98917cde58f8bbd42a1b1c03b1fd"
+ revision = "9beb055b7962d16947a14e1cd718098a2431e20e"
[[projects]]
digest = "1:04457f9f6f3ffc5fea48e71d62f2ca256637dee0a04d710288e27e05c8b41976"
@@ -168,6 +188,17 @@
[[projects]]
branch = "master"
+ digest = "1:04b43fe96213ea69cfa6e6b8be218a43a375035ea09d9bdda9fed2691f5a7e76"
+ name = "golang.org/x/crypto"
+ packages = [
+ "md4",
+ "pbkdf2",
+ ]
+ pruneopts = "UT"
+ revision = "4def268fd1a49955bfb3dda92fe3db4f924f2285"
+
+[[projects]]
+ branch = "master"
digest = "1:3e0062766e6b0bcfe1ba1ed1d3f08a8e1e99cd5831426e2596dc9537d28f2adb"
name = "golang.org/x/net"
packages = [
@@ -175,15 +206,84 @@
"proxy",
]
pruneopts = "UT"
- revision = "461777fb6f67e8cb9d70cda16573678d085a74cf"
+ revision = "da137c7871d730100384dbcf36e6f8fa493aef5b"
[[projects]]
branch = "master"
- digest = "1:8f5108406bc43c7669b0d67d282e40d05c9f268615fcaf8c1f0f76965aa3f09f"
+ digest = "1:31d44814b45607afa77c6e8ef20ea8bacc1d1053fe084440c874f311732e7ec3"
name = "golang.org/x/sys"
- packages = ["unix"]
+ packages = [
+ "unix",
+ "windows",
+ ]
pruneopts = "UT"
- revision = "7fc4e5ec1444df20dd195ae7c3bbfcd7114d3faa"
+ revision = "fae7ac547cb717d141c433a2a173315e216b64c4"
+
+[[projects]]
+ digest = "1:c902038ee2d6f964d3b9f2c718126571410c5d81251cbab9fe58abd37803513c"
+ name = "gopkg.in/jcmturner/aescts.v1"
+ packages = ["."]
+ pruneopts = "UT"
+ revision = "f6abebb3171c4c1b1fea279cb7c7325020a26290"
+ version = "v1.0.1"
+
+[[projects]]
+ digest = "1:a1a3e185c03d79a7452d5d5b4c91be4cc433f55e6ed3a35233d852c966e39013"
+ name = "gopkg.in/jcmturner/dnsutils.v1"
+ packages = ["."]
+ pruneopts = "UT"
+ revision = "13eeb8d49ffb74d7a75784c35e4d900607a3943c"
+ version = "v1.0.1"
+
+[[projects]]
+ digest = "1:dc01a587d07be012625ba63df6d4224ae6d7a83e79bfebde6d987c10538d66dd"
+ name = "gopkg.in/jcmturner/gokrb5.v7"
+ packages = [
+ "asn1tools",
+ "client",
+ "config",
+ "credentials",
+ "crypto",
+ "crypto/common",
+ "crypto/etype",
+ "crypto/rfc3961",
+ "crypto/rfc3962",
+ "crypto/rfc4757",
+ "crypto/rfc8009",
+ "gssapi",
+ "iana",
+ "iana/addrtype",
+ "iana/adtype",
+ "iana/asnAppTag",
+ "iana/chksumtype",
+ "iana/errorcode",
+ "iana/etypeID",
+ "iana/flags",
+ "iana/keyusage",
+ "iana/msgtype",
+ "iana/nametype",
+ "iana/patype",
+ "kadmin",
+ "keytab",
+ "krberror",
+ "messages",
+ "pac",
+ "types",
+ ]
+ pruneopts = "UT"
+ revision = "363118e62befa8a14ff01031c025026077fe5d6d"
+ version = "v7.3.0"
+
+[[projects]]
+ digest = "1:0f16d9c577198e3b8d3209f5a89aabe679525b2aba2a7548714e973035c0e232"
+ name = "gopkg.in/jcmturner/rpc.v1"
+ packages = [
+ "mstypes",
+ "ndr",
+ ]
+ pruneopts = "UT"
+ revision = "99a8ce2fbf8b8087b6ed12a37c61b10f04070043"
+ version = "v1.1.0"
[[projects]]
digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96"
@@ -200,6 +300,7 @@
"github.com/Shopify/sarama",
"github.com/gfremex/logrus-kafka-hook",
"github.com/prometheus/client_golang/prometheus",
+ "github.com/prometheus/client_golang/prometheus/promhttp",
"github.com/sirupsen/logrus",
"gopkg.in/yaml.v2",
]
diff --git a/VERSION b/VERSION
index e8ea05d..4dfdebd 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.4
+1.2.5-dev
diff --git a/main.go b/main.go
index 3880e98..81b1635 100644
--- a/main.go
+++ b/main.go
@@ -18,6 +18,7 @@
"gerrit.opencord.org/kafka-topic-exporter/common/logger"
"github.com/Shopify/sarama"
"github.com/prometheus/client_golang/prometheus"
+ "github.com/prometheus/client_golang/prometheus/promhttp"
"gopkg.in/yaml.v2"
"io/ioutil"
"log"
@@ -66,8 +67,11 @@
target.Port = 8080
}
logger.Debug("Starting HTTP Server on %d port", target.Port)
- http.Handle("/metrics", prometheus.Handler())
- http.ListenAndServe(":"+strconv.Itoa(target.Port), nil)
+ http.Handle("/metrics", promhttp.Handler())
+ err := http.ListenAndServe(":"+strconv.Itoa(target.Port), nil)
+ if err != nil {
+ logger.Error("HTTP Server Error: %s", err.Error())
+ }
}
func init() {
@@ -130,4 +134,4 @@
go kafkaInit(conf.Broker)
runServer(conf.Target)
-}
\ No newline at end of file
+}
diff --git a/topic-exporter.go b/topic-exporter.go
index 1713cfc..c306975 100644
--- a/topic-exporter.go
+++ b/topic-exporter.go
@@ -540,6 +540,7 @@
err := json.Unmarshal(data, &kpi)
if err != nil {
logger.Error("Invalid msg on voltha.kpis: %s, Unprocessed Msg: %s", err.Error(), string(data))
+ break
}
exportVolthaKPI(kpi)
case "onos.kpis":
@@ -547,6 +548,7 @@
err := json.Unmarshal(data, &kpi)
if err != nil {
logger.Error("Invalid msg on onos.kpis: %s, Unprocessed Msg: %s", err.Error(), string(data))
+ break
}
exportOnosKPI(kpi)
case "importer.kpis":
@@ -554,6 +556,7 @@
err := json.Unmarshal(data, &kpi)
if err != nil {
logger.Error("Invalid msg on importer.kpis: %s, Unprocessed Msg: %s", err.Error(), string(data))
+ break
}
exportImporterKPI(kpi)
case "onos.aaa.stats.kpis":
@@ -561,6 +564,7 @@
err := json.Unmarshal(data, &kpi)
if err != nil {
logger.Error("Invalid msg on onos.aaa.stats.kpis: %s, Unprocessed Msg: %s", err.Error(), string(data))
+ break
}
exportOnosAaaKPI(kpi)
default: