Skip to content

Commit

Permalink
dice: Revert otelslog usage (#6162)
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared authored Oct 1, 2024
1 parent 47b95b8 commit 21b406f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 5 additions & 1 deletion examples/dice/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module go.opentelemetry.io/contrib/examples/dice
go 1.22

require (
go.opentelemetry.io/contrib/bridges/otelslog v0.5.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0
go.opentelemetry.io/otel v1.30.0
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0
Expand All @@ -24,4 +25,7 @@ require (
golang.org/x/sys v0.25.0 // indirect
)

replace go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp => ../../instrumentation/net/http/otelhttp
replace (
go.opentelemetry.io/contrib/bridges/otelslog => ../../bridges/otelslog
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp => ../../instrumentation/net/http/otelhttp
)
7 changes: 2 additions & 5 deletions examples/dice/rolldice.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ package main
import (
"fmt"
"io"
"log/slog"
"math/rand"
"net/http"
"os"
"strconv"

// TODO: https://github.com/open-telemetry/opentelemetry-go/issues/5801
// "go.opentelemetry.io/contrib/bridges/otelslog".
"go.opentelemetry.io/contrib/bridges/otelslog"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
Expand All @@ -24,7 +21,7 @@ const name = "go.opentelemetry.io/contrib/examples/dice"
var (
tracer = otel.Tracer(name)
meter = otel.Meter(name)
logger = slog.New(slog.NewJSONHandler(os.Stdout, nil)) // TODO: logger = otelslog.NewLogger(name).
logger = otelslog.NewLogger(name)
rollCnt metric.Int64Counter
)

Expand Down

0 comments on commit 21b406f

Please sign in to comment.