Skip to content

Commit

Permalink
Remove overwriting sampling rate (#8086)
Browse files Browse the repository at this point in the history
## Summary
We were reseting the config option, wiping out the defaults, resulting
in no traces being recorded if `SamplingRateMap` was not set. Remove the
unnecessary reinitialization .

## How did you test this change?
1) Remove the `WithSamplingRateMap` from `backend/main.go` 
2) Start your backend and hit some endpoints
3) View traces/logs and confirm that they appear (check `service_name
EXISTS`)
- [ ] Logs are recorded
- [ ] Traces are recorded

## Are there any deployment considerations?
N/A

## Does this work require review from our design team?
N/A
  • Loading branch information
SpennyNDaJets committed Mar 22, 2024
1 parent 56cbba2 commit 112fa2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/orange-ravens-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'highlight.run': minor
---

Fix bug with recording traces.
4 changes: 2 additions & 2 deletions sdk/highlight-go/highlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package highlight

import (
"context"
"go.opentelemetry.io/otel/trace"
"net/http"
"os"
"os/signal"
Expand All @@ -11,6 +10,8 @@ import (
"syscall"
"time"

"go.opentelemetry.io/otel/trace"

"github.com/pkg/errors"
"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
Expand Down Expand Up @@ -154,7 +155,6 @@ func (d deadLog) Errorf(_ string, _ ...interface{}) {}
func init() {
interruptChan = make(chan bool, 1)
signalChan = make(chan os.Signal, 1)
conf = &config{}

signal.Notify(signalChan, syscall.SIGABRT, syscall.SIGTERM, syscall.SIGINT)
SetOTLPEndpoint(OTLPDefaultEndpoint)
Expand Down

0 comments on commit 112fa2c

Please sign in to comment.