Skip to content

Instantly share code, notes, and snippets.

@maplebed
Created July 23, 2019 23:28
Show Gist options
  • Save maplebed/b1e4122b4cda980d2d062a438a43b2d1 to your computer and use it in GitHub Desktop.
Save maplebed/b1e4122b4cda980d2d062a438a43b2d1 to your computer and use it in GitHub Desktop.
Adding global fields to the beeline
client, err := libhoney.NewClient(libhoney.ClientConfig{
APIHost: url,
APIKey: writeKey,
Dataset: dataset,
Transmission: &transmission.Honeycomb{
MaxBatchSize: libhoney.DefaultMaxBatchSize,
MaxConcurrentBatches: libhoney.DefaultMaxConcurrentBatches,
PendingWorkCapacity: libhoney.DefaultPendingWorkCapacity,
BatchTimeout: libhoney.DefaultBatchTimeout,
DisableGzipCompression: b.DisableGzipCompression,
},
SampleRate: b.SampleRate,
})
config := beeline.Config{
ServiceName: b.ServiceName,
SampleRate: b.SampleRate,
Client: client,
}
beeline.Init(config)
client.addField("global.os_version", osVersion)
client.addField("global.build_id", BuildID)
@kevincantu
Copy link

And are the two SampleRates redundant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment