Skip to content

Commit

Permalink
improve documentation of hte SdkTraceScope
Browse files Browse the repository at this point in the history
  • Loading branch information
iRevive committed Dec 8, 2023
1 parent e134b6a commit d70a75d
Show file tree
Hide file tree
Showing 6 changed files with 275 additions and 68 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.typelevel.otel4s.sdk.trace

import cats.effect.SyncIO
import org.typelevel.otel4s.sdk.context.Context
import org.typelevel.otel4s.trace.SpanContext

/** The keys that may be used by a third-party integrations.
*/
object SdkContextKeys {

/** The [[SpanContext]] is stored under this key in the [[Context]].
*
* To retrieve the context use:
* {{{
* val context: Context = ???
* val spanContext: Option[SpanContext] = context.get(SdkContextKeys.SpanContextKey)
* }}}
*/
val SpanContextKey: Context.Key[SpanContext] =
Context.Key
.unique[SyncIO, SpanContext]("otel4s-trace-span-context-key")
.unsafeRunSync()

}
Loading

0 comments on commit d70a75d

Please sign in to comment.