From c9d6404c5a8316f39c919d8b15fca3e48b5c2369 Mon Sep 17 00:00:00 2001 From: Leon Burdinov Date: Mon, 28 Aug 2023 14:27:58 +0300 Subject: [PATCH] GH commit metadata ts is in UTC (#36774) GH commit metadata ts is in UTC #pr #skipreview GitOrigin-RevId: 2efd9f9a307f625f4112ca172cd53e256bcd24f7 --- .../com/wixpress/dst/greyhound/core/consumer/Consumer.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/com/wixpress/dst/greyhound/core/consumer/Consumer.scala b/core/src/main/scala/com/wixpress/dst/greyhound/core/consumer/Consumer.scala index f9c07e29..d8d0c15d 100644 --- a/core/src/main/scala/com/wixpress/dst/greyhound/core/consumer/Consumer.scala +++ b/core/src/main/scala/com/wixpress/dst/greyhound/core/consumer/Consumer.scala @@ -173,9 +173,10 @@ object Consumer { import java.time.format.DateTimeFormatter import java.time.LocalDateTime + import java.time.ZoneOffset private val podName = sys.env.get("POD_NAME") private val dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss") - def metadata: Option[String] = if (config.enrichMetadata) podName.map(name => s">>> pod: $name, ts: ${dtf.format(LocalDateTime.now())}") else None + def metadata: Option[String] = if (config.enrichMetadata) podName.map(name => s">>> pod: $name, ts: ${dtf.format(LocalDateTime.now(ZoneOffset.UTC))}") else None override def commit(offsets: Map[TopicPartition, Offset])(implicit trace: Trace): RIO[GreyhoundMetrics, Unit] = { withConsumerBlocking(_.commitSync(kafkaOffsetsAndMetaData(toOffsetsAndMetadata(offsets, metadata.getOrElse(cfg.commitMetadataString)))))