diff --git a/node/cmd/guardiand/node.go b/node/cmd/guardiand/node.go index 8fa604ef26..e434d25e59 100644 --- a/node/cmd/guardiand/node.go +++ b/node/cmd/guardiand/node.go @@ -1055,11 +1055,11 @@ func runNode(cmd *cobra.Command, args []string) { if (err != nil) || (statusPort64 == 0) { logger.Fatal("Please specify a valid --statusAddr") } else { - // TODO: check when the http server gets started. info.StatusPort = uint16(statusPort64) promLogger := logger.With(zap.String("component", "prometheus_scraper")) errC := make(chan error) common.StartRunnable(rootCtx, errC, false, "prometheus_scraper", func(ctx context.Context) error { + // This initial sleep allows the http server to start up. t := time.NewTicker(15 * time.Second) for { diff --git a/node/pkg/proto/prometheus/v1/remote.pb.go b/node/pkg/proto/prometheus/v1/remote.pb.go index 43d3d5a692..901273d94a 100644 --- a/node/pkg/proto/prometheus/v1/remote.pb.go +++ b/node/pkg/proto/prometheus/v1/remote.pb.go @@ -12,6 +12,8 @@ // limitations under the License. // NOTICE: THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL +// Changes were made to use go protobuf instead of gogo protobuf. +// Original code is here: https://github.com/prometheus/prometheus/blob/e4ec263bcc11493953c75d1b2e7bc78fd0463e05/prompb/remote.proto // Code generated by protoc-gen-go. DO NOT EDIT. // versions: diff --git a/node/pkg/proto/prometheus/v1/types.pb.go b/node/pkg/proto/prometheus/v1/types.pb.go index 4f054f8a26..a2dd60a5af 100644 --- a/node/pkg/proto/prometheus/v1/types.pb.go +++ b/node/pkg/proto/prometheus/v1/types.pb.go @@ -12,6 +12,8 @@ // limitations under the License. // NOTICE: THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL +// Changes were made to use go protobuf instead of gogo protobuf. +// Original code is here: https://github.com/prometheus/prometheus/blob/e4ec263bcc11493953c75d1b2e7bc78fd0463e05/prompb/types.proto // Code generated by protoc-gen-go. DO NOT EDIT. // versions: diff --git a/node/pkg/telemetry/prom_remote_write/format.go b/node/pkg/telemetry/prom_remote_write/format.go index 6b453c6d1c..ff20471123 100644 --- a/node/pkg/telemetry/prom_remote_write/format.go +++ b/node/pkg/telemetry/prom_remote_write/format.go @@ -12,6 +12,8 @@ // limitations under the License. // NOTICE: THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL +// Changes were made to use go protobuf instead of gogo protobuf. +// Original code is here: https://github.com/prometheus/prometheus/blob/e4ec263bcc11493953c75d1b2e7bc78fd0463e05/util/fmtutil/format.go package promremotew diff --git a/node/pkg/telemetry/prom_remote_write/prom_test.go b/node/pkg/telemetry/prom_remote_write/prom_test.go index dc10d5d794..127ba126a7 100644 --- a/node/pkg/telemetry/prom_remote_write/prom_test.go +++ b/node/pkg/telemetry/prom_remote_write/prom_test.go @@ -4,7 +4,6 @@ import ( "bytes" "testing" - // "github.com/certusone/wormhole/node/pkg/telemetry/prom_remote_write/prompb" prometheusv1 "github.com/certusone/wormhole/node/pkg/proto/prometheus/v1" "google.golang.org/protobuf/proto" @@ -201,14 +200,8 @@ func TestMarshalUnmarshal(t *testing.T) { wr := prometheusv1.WriteRequest{Timeseries: timeseries} bytes, err := proto.Marshal(&wr) require.NoError(t, err) - // if err != nil { - // panic("Failed to marshall: " + err.Error()) - // } newWr := prometheusv1.WriteRequest{} - err = proto.Unmarshal(bytes, &newWr) // this line causes panic + err = proto.Unmarshal(bytes, &newWr) require.NoError(t, err) - // if err != nil { - // panic("Failed to unmarshall: " + err.Error()) - // } } diff --git a/node/pkg/telemetry/prom_remote_write/scrape.go b/node/pkg/telemetry/prom_remote_write/scrape.go index 3741088d7a..17f7b276cd 100644 --- a/node/pkg/telemetry/prom_remote_write/scrape.go +++ b/node/pkg/telemetry/prom_remote_write/scrape.go @@ -93,16 +93,3 @@ func ScrapeAndSendLocalMetrics(ctx context.Context, info PromTelemetryInfo, logg } return nil } - -// func StartPrometheusScraper(ctx context.Context, info PromTelemetryInfo, logger *zap.Logger) error { -// promLogger := logger.With(zap.String("component", "prometheus_scraper")) -// for { -// // Sleeping first to give things a chance to set up -// time.Sleep(15 * time.Second) -// ScrapeAndSendLocalMetrics(info, promLogger) -// select { -// case <-ctx.Done(): -// return ctx.Err() -// } -// } -// } diff --git a/proto/prometheus/v1/remote.proto b/proto/prometheus/v1/remote.proto index 0850c6d249..c301aa8dad 100644 --- a/proto/prometheus/v1/remote.proto +++ b/proto/prometheus/v1/remote.proto @@ -12,6 +12,8 @@ // limitations under the License. // NOTICE: THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL +// Changes were made to use go protobuf instead of gogo protobuf. +// Original code is here: https://github.com/prometheus/prometheus/blob/e4ec263bcc11493953c75d1b2e7bc78fd0463e05/prompb/remote.proto syntax = "proto3"; package prometheus.v1; diff --git a/proto/prometheus/v1/types.proto b/proto/prometheus/v1/types.proto index 585b9b3ead..cdc6cbda94 100644 --- a/proto/prometheus/v1/types.proto +++ b/proto/prometheus/v1/types.proto @@ -12,6 +12,8 @@ // limitations under the License. // NOTICE: THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL +// Changes were made to use go protobuf instead of gogo protobuf. +// Original code is here: https://github.com/prometheus/prometheus/blob/e4ec263bcc11493953c75d1b2e7bc78fd0463e05/prompb/types.proto syntax = "proto3"; package prometheus.v1;