You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-07-03 00:27:03 +02:00
Restore the experimental/streaming SDK implementation (#55)
* Fix streaming - part 1 * Eliminate span{} state * Eliminate trace/ dir * Avoid missing AddEvent helpers
This commit is contained in:
committed by
rghetia
parent
2c77e484b4
commit
b26d6675ed
@ -23,7 +23,6 @@ import (
|
||||
"go.opentelemetry.io/api/stats"
|
||||
"go.opentelemetry.io/api/tag"
|
||||
"go.opentelemetry.io/api/trace"
|
||||
"go.opentelemetry.io/experimental/streaming/sdk/event"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -64,7 +63,7 @@ func main() {
|
||||
|
||||
err := tracer.WithSpan(ctx, "operation", func(ctx context.Context) error {
|
||||
|
||||
trace.CurrentSpan(ctx).AddEvent(ctx, event.WithAttr("Nice operation!", key.New("bogons").Int(100)))
|
||||
trace.CurrentSpan(ctx).Event(ctx, "Nice operation!", key.New("bogons").Int(100))
|
||||
|
||||
trace.CurrentSpan(ctx).SetAttributes(anotherKey.String("yes"))
|
||||
|
||||
@ -76,7 +75,7 @@ func main() {
|
||||
func(ctx context.Context) error {
|
||||
trace.CurrentSpan(ctx).SetAttribute(lemonsKey.String("five"))
|
||||
|
||||
trace.CurrentSpan(ctx).AddEvent(ctx, event.WithString("Format schmormat %d!", 100))
|
||||
trace.CurrentSpan(ctx).Event(ctx, "Sub span event")
|
||||
|
||||
stats.Record(ctx, measureTwo.M(1.3))
|
||||
|
||||
|
Reference in New Issue
Block a user