Skip to content

Commit

Permalink
Merge pull request #28525 from dgoodwin/remove-loki-interval-upload
Browse files Browse the repository at this point in the history
TRT-1441: Stop uploading intervals to loki
  • Loading branch information
openshift-merge-bot[bot] committed Jan 15, 2024
2 parents 24e011b + f9abf0d commit bcc243a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 405 deletions.
35 changes: 0 additions & 35 deletions pkg/cmd/openshift-tests/dev/dev.go
Expand Up @@ -5,8 +5,6 @@ import (
"io/ioutil"
"os"

"github.com/openshift/origin/pkg/monitortests/testframework/uploadtolokiserializer"

configv1 "github.com/openshift/api/config/v1"
"github.com/openshift/origin/pkg/alerts"
"github.com/openshift/origin/pkg/monitor/monitorapi"
Expand All @@ -29,7 +27,6 @@ func NewDevCommand() *cobra.Command {
cmd.AddCommand(
newRunAlertInvariantsCommand(),
newRunDisruptionInvariantsCommand(),
newUploadIntervalsCommand(),
)
return cmd
}
Expand Down Expand Up @@ -199,35 +196,3 @@ a running cluster.
"Topology for simulated cluster under test when intervals were gathered (ha, single)")
return cmd
}

type uploadIntervalsOpts struct {
intervalsFile string
}

func newUploadIntervalsCommand() *cobra.Command {
opts := uploadIntervalsOpts{}

cmd := &cobra.Command{
Use: "upload-intervals",
Short: "Upload an intervals file from a CI run to loki",

RunE: func(cmd *cobra.Command, args []string) error {
logrus.WithField("intervalsFile", opts.intervalsFile).Info("loading e2e intervals")
intervals, err := readIntervalsFromFile(opts.intervalsFile)
if err != nil {
logrus.WithError(err).Fatal("error loading intervals file")
}
logrus.Infof("loaded %d intervals", len(intervals))

err = uploadtolokiserializer.UploadIntervalsToLoki(intervals)
if err != nil {
logrus.WithError(err).Fatal("error uploading intervals to loki")
}
return nil
},
}
cmd.Flags().StringVar(&opts.intervalsFile,
"intervals-file", "e2e-events.json",
"Path to an intervals file (i.e. e2e-events_20230214-203340.json). Can be obtained from a CI run in openshift-tests junit artifacts.")
return cmd
}
3 changes: 1 addition & 2 deletions pkg/defaultmonitortests/types.go
Expand Up @@ -2,6 +2,7 @@ package defaultmonitortests

import (
"fmt"

"github.com/openshift/origin/pkg/monitortests/testframework/watchrequestcountscollector"
"github.com/sirupsen/logrus"

Expand Down Expand Up @@ -43,7 +44,6 @@ import (
"github.com/openshift/origin/pkg/monitortests/testframework/legacytestframeworkmonitortests"
"github.com/openshift/origin/pkg/monitortests/testframework/timelineserializer"
"github.com/openshift/origin/pkg/monitortests/testframework/trackedresourcesserializer"
"github.com/openshift/origin/pkg/monitortests/testframework/uploadtolokiserializer"
"github.com/openshift/origin/pkg/monitortests/testframework/watchclusteroperators"
"github.com/openshift/origin/pkg/monitortests/testframework/watchevents"
)
Expand Down Expand Up @@ -162,7 +162,6 @@ func newUniversalMonitorTests(info monitortestframework.MonitorTestInitializatio
monitorTestRegistry.AddMonitorTestOrDie("cluster-info-serializer", "Test Framework", clusterinfoserializer.NewClusterInfoSerializer())
monitorTestRegistry.AddMonitorTestOrDie("additional-events-collector", "Test Framework", additionaleventscollector.NewIntervalSerializer())
monitorTestRegistry.AddMonitorTestOrDie("known-image-checker", "Test Framework", knownimagechecker.NewEnsureValidImages())
monitorTestRegistry.AddMonitorTestOrDie("upload-to-loki-serializer", "Test Framework", uploadtolokiserializer.NewUploadSerializer())
monitorTestRegistry.AddMonitorTestOrDie("e2e-test-analyzer", "Test Framework", e2etestanalyzer.NewAnalyzer())
monitorTestRegistry.AddMonitorTestOrDie("event-collector", "Test Framework", watchevents.NewEventWatcher())
monitorTestRegistry.AddMonitorTestOrDie("clusteroperator-collector", "Test Framework", watchclusteroperators.NewOperatorWatcher())
Expand Down

0 comments on commit bcc243a

Please sign in to comment.