@@ -1396,79 +1396,6 @@ func CheckTracesWithoutGatewayInstall(builder *features.FeatureBuilder) *feature
13961396 )
13971397}
13981398
1399- // GetRemoteWriteMetricsFeature creates a feature that deploys a minimal Prometheus instance
1400- // configured to remote_write (v2) to the collector's prometheusremotewrite receiver on port 9888,
1401- // then verifies those metrics arrive at sumologic-mock.
1402- func GetRemoteWriteMetricsFeature () features.Feature {
1403- return features .New ("remote_write_metrics" ).
1404- Setup (func (ctx context.Context , t * testing.T , envConf * envconf.Config ) context.Context {
1405- release := strings_internal .ReleaseNameFromT (t )
1406- namespace := ctxopts .Namespace (ctx )
1407- remoteWriteURL := fmt .Sprintf (
1408- "http://%s-sumologic-metrics-collector.%s.svc.my.cluster:9888/api/v1/write" ,
1409- release , namespace ,
1410- )
1411-
1412- rwNamespace := internal .RemoteWritePrometheusNamespace
1413-
1414- nsObj := & corev1.Namespace {
1415- ObjectMeta : v1.ObjectMeta {Name : rwNamespace },
1416- }
1417- err := envConf .Client ().Resources ().Create (ctx , nsObj )
1418- require .NoError (t , err )
1419-
1420- configData := fmt .Sprintf (`global:
1421- scrape_interval: 10s
1422- external_labels:
1423- source: remote_write_test
1424- scrape_configs:
1425- - job_name: "remote-write-test"
1426- static_configs:
1427- - targets: ["localhost:9090"]
1428- remote_write:
1429- - url: %s
1430- ` , remoteWriteURL )
1431-
1432- cm := & corev1.ConfigMap {
1433- ObjectMeta : v1.ObjectMeta {
1434- Name : "prometheus-remote-write-config" ,
1435- Namespace : rwNamespace ,
1436- },
1437- Data : map [string ]string {
1438- "prometheus.yml" : configData ,
1439- },
1440- }
1441- err = envConf .Client ().Resources (rwNamespace ).Create (ctx , cm )
1442- require .NoError (t , err )
1443-
1444- kubectlOpts := * ctxopts .KubectlOptions (ctx , envConf )
1445- kubectlOpts .Namespace = rwNamespace
1446- terrak8s .RunKubectl (t , & kubectlOpts , "apply" , "-f" , internal .RemoteWritePrometheusTest ) //nolint:staticcheck
1447- return ctx
1448- }).
1449- Assess ("remote write metrics are present in sumologic-mock" ,
1450- stepfuncs .WaitUntilExpectedMetricsPresentWithFilters (
1451- []string {"prometheus_build_info" },
1452- sumologicmock.MetadataFilters {"job" : "remote-write-test" },
1453- false ,
1454- 5 * time .Minute ,
1455- tickDuration ,
1456- ),
1457- ).
1458- Teardown (func (ctx context.Context , t * testing.T , envConf * envconf.Config ) context.Context {
1459- rwNamespace := internal .RemoteWritePrometheusNamespace
1460- kubectlOpts := * ctxopts .KubectlOptions (ctx , envConf )
1461- kubectlOpts .Namespace = rwNamespace
1462- terrak8s .RunKubectl (t , & kubectlOpts , "delete" , "-f" , internal .RemoteWritePrometheusTest ) //nolint:staticcheck
1463- nsObj := & corev1.Namespace {
1464- ObjectMeta : v1.ObjectMeta {Name : rwNamespace },
1465- }
1466- envConf .Client ().Resources ().Delete (ctx , nsObj ) //nolint:errcheck
1467- return ctx
1468- }).
1469- Feature ()
1470- }
1471-
14721399func CheckTailingSidecarOperatorInstall (builder * features.FeatureBuilder ) * features.FeatureBuilder {
14731400 return builder .
14741401 Assess ("tailing sidecar deployment is ready" ,
0 commit comments