Skip to content

Commit

Permalink
honey - enable sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianZaremba committed Dec 13, 2024
1 parent 1ccf3a1 commit 6e07227
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ func main() {
otelconfig.WithServiceName("ClueBot NG"),
}
if configuration.Honey.Key != "" {
for k, v := range map[string]string{
"OTEL_TRACES_SAMPLER": "traceidratio",
"OTEL_TRACES_SAMPLER_ARG": "0.5",
"OTEL_RESOURCE_ATTRIBUTES": "SampleRate=2",
} {
if err := os.Setenv(k, v); err != nil {
logrus.Warnf("failed to set sampling env var (%s -> %v): %s", k, v, err)
}
}

otelOptions = append(otelOptions, otelconfig.WithExporterProtocol(otelconfig.ProtocolHTTPProto))
otelOptions = append(otelOptions, otelconfig.WithExporterEndpoint("https://api.honeycomb.io"))
otelOptions = append(otelOptions, otelconfig.WithHeaders(map[string]string{
Expand Down

0 comments on commit 6e07227

Please sign in to comment.