Skip to content

Commit

Permalink
misc(sparkjobs): force push metrics publish from index job (#1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
sherali42 authored Oct 2, 2024
1 parent aab8633 commit 33e4656
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package filodb.downsampler.index

import scala.concurrent.Await
import scala.concurrent.duration.DurationInt

import kamon.Kamon
import kamon.metric.MeasurementUnit
Expand Down Expand Up @@ -88,8 +89,11 @@ class DSIndexJob(dsSettings: DownsamplerSettings,
sparkTasksFailed.increment
throw e
}

// quick & dirty hack to ensure that the completed metric gets published
if (dsSettings.shouldSleepForMetricsFlush)
Thread.sleep(62000) // quick & dirty hack to ensure that the completed metric gets published
Await.result(Kamon.stopModules(), 62.seconds)

}

def migrateWithDownsamplePartKeys(partKeys: Observable[PartKeyRecord], shard: Int): Int = {
Expand Down

0 comments on commit 33e4656

Please sign in to comment.