Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PI-2342 Update polls to be logged as request spans #4033

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package uk.gov.justice.digital.hmpps.service

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
import io.opentelemetry.api.trace.SpanKind
import io.opentelemetry.instrumentation.annotations.WithSpan
import org.springframework.beans.factory.annotation.Value
import org.springframework.data.domain.Pageable
Expand Down Expand Up @@ -29,7 +30,7 @@ class DomainEventService(

fun deleteAll(deltas: List<DomainEvent>) = domainEventRepository.deleteAllByIdInBatch(deltas.map { it.id })

@WithSpan("POLL domain_event")
@WithSpan("POLL domain_event", kind = SpanKind.SERVER)
fun notify(delta: DomainEvent) {
val notification = notificationEnhancer.enhance(delta.asNotification())
notificationPublisher.publish(notification)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package uk.gov.justice.digital.hmpps.integrations.delius.offender

import io.opentelemetry.api.trace.SpanKind
import io.opentelemetry.instrumentation.annotations.WithSpan
import org.springframework.beans.factory.annotation.Value
import org.springframework.data.domain.Pageable
Expand All @@ -23,7 +24,7 @@ class OffenderDeltaService(

fun deleteAll(deltas: List<OffenderDelta>) = repository.deleteAllByIdInBatch(deltas.map { it.id })

@WithSpan("POLL offender_delta")
@WithSpan("POLL offender_delta", kind = SpanKind.SERVER)
fun notify(delta: OffenderDelta) {
delta.asNotifications().forEach {
notificationPublisher.publish(it)
Expand Down