Skip to content

Commit f25c49e

Browse files
committed
La inn delt 'aarsak' otel attrib key
1 parent c895b60 commit f25c49e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

apps/hendelseprosessor/src/main/kotlin/no/nav/paw/arbeidssokerregisteret/app/funksjoner/Filter.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fun ignorerDuplikatStartOgStopp(
2929
hendelseIgnorert, Attributes.of(
3030
AttributeKey.stringKey("arbeidssoekerregisteret_hendelse_type"),
3131
hendelse.hendelseType,
32-
AttributeKey.stringKey("aarsak"),
32+
aarsakKey,
3333
tilstand?.gjeldeneTilstand?.name ?: "null"
3434
)
3535
)
@@ -53,7 +53,7 @@ fun ignorerAvsluttetForAnnenPeriode(
5353
hendelseIgnorert, Attributes.of(
5454
AttributeKey.stringKey("arbeidssoekerregisteret_hendelse_type"),
5555
hendelse.hendelseType,
56-
AttributeKey.stringKey("aarsak"),
56+
aarsakKey,
5757
"ulik_periode_id"
5858
)
5959
)
@@ -79,7 +79,7 @@ fun ignorerOpphoerteIdenter(
7979
hendelseIgnorert, Attributes.of(
8080
AttributeKey.stringKey("arbeidssoekerregisteret_hendelse_type"),
8181
hendelse.hendelseType,
82-
AttributeKey.stringKey("aarsak"),
82+
aarsakKey,
8383
tilstand?.gjeldeneTilstand?.name ?: "null"
8484
)
8585
)

apps/hendelseprosessor/src/main/kotlin/no/nav/paw/arbeidssokerregisteret/app/funksjoner/TracingHendelser.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ const val hendelseAkseptert = "arbeidssoekerregisteret_hendelse_akseptert"
99

1010
val hendelseTypeKey = AttributeKey.stringKey("arbeidssoekerregisteret_hendelse_type")
1111
val tilstandKey = AttributeKey.stringKey("arbeidssoekerregisteret_tilstand")
12+
val aarsakKey = AttributeKey.stringKey("aarsak")
1213

1314
fun hendelseType(hendelse: StreamHendelse): Pair<AttributeKey<String>, String> =
1415
hendelseTypeKey to hendelse.hendelseType.replace(".", "_")
1516

1617
fun aarsak(aarsak: String): Pair<AttributeKey<String>, String> =
17-
AttributeKey.stringKey("aarsak") to aarsak
18+
aarsakKey to aarsak
1819

1920
fun <A: Any> AttributesBuilder.add(kv: Pair<AttributeKey<A>, A>) : AttributesBuilder = this.put(kv.first, kv.second)

0 commit comments

Comments
 (0)