Skip to content

Commit

Permalink
chore(monitoring): Enable New Relic tracing in select methods (#1602)
Browse files Browse the repository at this point in the history
  • Loading branch information
luispollo committed Oct 15, 2020
1 parent 7fe8912 commit 5d31d90
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion keel-core/keel-core.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ dependencies {
api("com.github.ben-manes.caffeine:caffeine")

implementation("org.springframework:spring-tx")

implementation ("io.github.resilience4j:resilience4j-kotlin")
implementation ("io.github.resilience4j:resilience4j-retry")
implementation("com.newrelic.agent.java:newrelic-api:6.1.0")

testImplementation(project(":keel-test"))
testImplementation(project(":keel-core-test"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.netflix.spinnaker.keel.core.api.EnvironmentArtifactVetoes
import com.netflix.spinnaker.keel.core.api.PinnedEnvironment
import com.netflix.spinnaker.keel.persistence.KeelRepository
import com.netflix.spinnaker.keel.telemetry.ArtifactVersionApproved
import com.newrelic.api.agent.Trace
import org.slf4j.LoggerFactory
import org.springframework.context.ApplicationEventPublisher
import org.springframework.stereotype.Component
Expand All @@ -22,6 +23,7 @@ class EnvironmentPromotionChecker(
) {
private val log by lazy { LoggerFactory.getLogger(javaClass) }

@Trace(dispatcher=true)
suspend fun checkEnvironments(deliveryConfig: DeliveryConfig) {
val pinnedEnvs: Map<String, PinnedEnvironment> = repository
.pinnedEnvironments(deliveryConfig)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import com.netflix.spinnaker.keel.veto.VetoResponse
import com.netflix.spinnaker.kork.exceptions.SpinnakerException
import com.netflix.spinnaker.kork.exceptions.SystemException
import com.netflix.spinnaker.kork.exceptions.UserException
import com.newrelic.api.agent.Trace
import kotlinx.coroutines.async
import kotlinx.coroutines.supervisorScope
import org.slf4j.LoggerFactory
Expand Down Expand Up @@ -75,6 +76,7 @@ class ResourceActuator(
private val diffNotActionableEnabled: Boolean
get() = springEnv.getProperty("keel.events.diff-not-actionable.enabled", Boolean::class.java, false)

@Trace(dispatcher=true)
suspend fun <T : ResourceSpec> checkResource(resource: Resource<T>) {
withTracingContext(resource) {
val id = resource.id
Expand Down

0 comments on commit 5d31d90

Please sign in to comment.