Skip to content

Commit

Permalink
chore: adding withspan on endpoints for open telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
jaflaten committed Dec 9, 2024
1 parent b305409 commit 10a64a0
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package no.nav.sykdig.digitalisering.papirsykmelding.api

import io.opentelemetry.instrumentation.annotations.WithSpan
import no.nav.sykdig.applog
import no.nav.sykdig.digitalisering.helsenett.SykmelderService
import no.nav.sykdig.digitalisering.papirsykmelding.NasjonalCommonService
Expand Down Expand Up @@ -42,6 +43,7 @@ class NasjonalOppgaveController(

@PostMapping("/oppgave/{oppgaveId}/avvis")
@PreAuthorize("@oppgaveSecurityService.hasAccessToNasjonalOppgave(#oppgaveId, #authorization)")
@WithSpan
fun avvisOppgave(
@PathVariable oppgaveId: String,
@RequestHeader("X-Nav-Enhet") navEnhet: String,
Expand All @@ -55,6 +57,7 @@ class NasjonalOppgaveController(
@GetMapping("/oppgave/{oppgaveId}")
@PostAuthorize("@oppgaveSecurityService.hasAccessToNasjonalOppgave(#oppgaveId, #authorization)")
@ResponseBody
@WithSpan
fun getPapirsykmeldingManuellOppgave(
@PathVariable oppgaveId: String,
@RequestHeader("Authorization") authorization: String,
Expand Down Expand Up @@ -106,6 +109,7 @@ class NasjonalOppgaveController(
@PostMapping("/oppgave/{oppgaveId}/send")
@PreAuthorize("@oppgaveSecurityService.hasAccessToNasjonalOppgave(#oppgaveId, #authorization)")
@ResponseBody
@WithSpan
suspend fun sendOppgave(
@PathVariable oppgaveId: String,
@RequestHeader("Authorization") authorization: String,
Expand All @@ -120,6 +124,7 @@ class NasjonalOppgaveController(
@GetMapping("/sykmelding/{sykmeldingId}/ferdigstilt")
@PostAuthorize("@oppgaveSecurityService.hasAccessToNasjonalSykmelding(#sykmeldingId, #authorization)")
@ResponseBody
@WithSpan
fun getFerdigstiltSykmelding(
@PathVariable sykmeldingId: String,
@RequestHeader("Authorization") authorization: String,
Expand Down Expand Up @@ -147,6 +152,7 @@ class NasjonalOppgaveController(

@PostMapping("/sykmelding/{sykmeldingId}")
@PreAuthorize("@oppgaveSecurityService.hasAccessToNasjonalSykmelding(#sykmeldingId, #authorization)")
@WithSpan
fun korrigerSykmelding(
@PathVariable sykmeldingId: String,
@RequestHeader("Authorization") authorization: String,
Expand Down

0 comments on commit 10a64a0

Please sign in to comment.