-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cats effect 3: pass transaction info by implicits
- Loading branch information
1 parent
0da09b0
commit e6ad762
Showing
5 changed files
with
158 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
...lic-cats-effect3-api/src/main/scala/com/newrelic/cats3/api/TraceOps_Instrumentation.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
package com.newrelic.cats3.api | ||
|
||
import cats.effect.Sync | ||
import com.newrelic.api.agent.NewRelic | ||
import com.newrelic.api.agent.weaver.Weaver | ||
import com.newrelic.api.agent.weaver.scala.{ScalaMatchType, ScalaWeave} | ||
|
||
@ScalaWeave(`type` = ScalaMatchType.Object, `originalName` = "com.newrelic.cats3.api.TraceOps") | ||
class TraceOps_Instrumentation { | ||
def txn[S, F[_]:Sync](body: F[S]): F[S] = { | ||
Util.wrapTrace(Weaver.callOriginal) | ||
// def txnInfo: TxnInfo = Weaver.callOriginal() | ||
|
||
|
||
def txn[S, F[_]:Sync](body: TxnInfo => F[S]): F[S] = { | ||
Util.wrapTrace(body) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.