Created
July 23, 2019 23:28
-
-
Save maplebed/b1e4122b4cda980d2d062a438a43b2d1 to your computer and use it in GitHub Desktop.
Adding global fields to the beeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And are the two
SampleRate
s redundant?