@@ -186,12 +186,15 @@ func TestMarklogicCluster(t *testing.T) {
186186 }
187187 if ! (strings .Contains (string (output ), "Datasource added" ) && strings .Contains (string (output ), "Loki" )) {
188188 t .Fatal ("Failed to create datasource for Grafana" )
189+ } else {
190+ t .Logf ("Datasource created successfully: %s" , output )
189191 }
190192 var dataSourceResponse DataSourceResponse
191193 if err := json .Unmarshal ([]byte (output ), & dataSourceResponse ); err != nil {
192194 t .Fatalf ("Failed to unmarshal JSON response: %v" , err )
193195 }
194196 dataSourceUID = dataSourceResponse .DataSource .UID
197+ t .Logf ("Datasource UID: %s" , dataSourceUID )
195198 return ctx
196199 })
197200
@@ -272,14 +275,16 @@ func TestMarklogicCluster(t *testing.T) {
272275 dashboardUID = dashboardResponse .UID
273276 if dashboardResponse .Status != "success" {
274277 t .Fatal ("Failed to create dashboard with loki and fluent-bit" )
278+ } else {
279+ t .Logf ("Dashboard created successfully with UID: %s" , dashboardResponse .UID )
275280 }
276281
277282 // Create query to verify MarkLogic logs in Grafana
278283 payload := map [string ]interface {}{
279284 "queries" : []map [string ]interface {}{
280285 {
281286 "refId" : "A" ,
282- "expr" : "{job=\" fluent-bit\" } |= ``" ,
287+ "expr" : "{job=\" fluent-bit\" } |= `Starting MarkLogic Server `" ,
283288 "queryType" : "range" ,
284289 "datasource" : map [string ]string {
285290 "type" : "loki" ,
@@ -293,7 +298,7 @@ func TestMarklogicCluster(t *testing.T) {
293298 "maxDataPoints" : 1073 ,
294299 },
295300 },
296- "from" : "now-5m " ,
301+ "from" : "now-1h " ,
297302 "to" : "now" ,
298303 }
299304
0 commit comments