using consumer_id UUID in metrics instead of primary key

This commit is contained in:
simonredfern 2025-11-22 21:48:33 +01:00
parent d7eba5972f
commit e1d10e957a
2 changed files with 5 additions and 5 deletions

View File

@ -120,7 +120,7 @@ case class CallContext(
gatewayLoginResponseHeader = this.gatewayLoginResponseHeader,
userId = this.user.map(_.userId).toOption,
userName = this.user.map(_.name).toOption,
consumerId = this.consumer.map(_.id.get).toOption,
consumerId = this.consumer.map(_.consumerId.get).toOption,
appName = this.consumer.map(_.name.get).toOption,
developerEmail = this.consumer.map(_.developerEmail.get).toOption,
spelling = this.spelling,
@ -192,7 +192,7 @@ case class CallContextLight(gatewayLoginRequestPayload: Option[PayloadOfJwtJSON]
gatewayLoginResponseHeader: Option[String] = None,
userId: Option[String] = None,
userName: Option[String] = None,
consumerId: Option[Long] = None,
consumerId: Option[String] = None,
appName: Option[String] = None,
developerEmail: Option[String] = None,
spelling: Option[String] = None,

View File

@ -58,7 +58,7 @@ object WriteMetricUtil extends MdcLoggable {
//execute saveMetric in future, as we do not need to know result of the operation
Future {
val consumerId = cc.consumerId.getOrElse(-1)
val consumerId = cc.consumerId.getOrElse("null")
val appName = cc.appName.orNull
val developerEmail = cc.developerEmail.orNull
@ -70,7 +70,7 @@ object WriteMetricUtil extends MdcLoggable {
userName,
appName,
developerEmail,
consumerId.toString,
consumerId,
implementedByPartialFunction,
cc.implementedInVersion,
cc.verb,
@ -142,7 +142,7 @@ object WriteMetricUtil extends MdcLoggable {
val c: Consumer = consumer.orNull
//The consumerId, not key
val consumerId = if (u != null) c.id.toString() else "null"
val consumerId = if (c != null) c.consumerId.get else "null"
var appName = if (u != null) c.name.toString() else "null"
var developerEmail = if (u != null) c.developerEmail.toString() else "null"
val implementedByPartialFunction = rd match {