Skip to content

Commit

Permalink
GH commit metadata ts is in UTC (#36774)
Browse files Browse the repository at this point in the history
GH commit metadata ts is in UTC #pr #skipreview

GitOrigin-RevId: 2efd9f9a307f625f4112ca172cd53e256bcd24f7
  • Loading branch information
leonbur authored and wix-oss committed Sep 3, 2023
1 parent 785d0b9 commit c9d6404
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))
Expand Down

0 comments on commit c9d6404

Please sign in to comment.