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
package main | |
import ( | |
"fmt" | |
"sync" | |
libhoney "github.com/honeycombio/libhoney-go" | |
"github.com/honeycombio/libhoney-go/transmission" | |
) |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"os" | |
"sync" | |
"time" | |
libhoney "github.com/honeycombio/libhoney-go" |
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
const ( | |
// beeline pre-sampling | |
shepherdOverallSampleRate = 3 | |
triadSampleRate = 4 | |
) | |
... initialization ... | |
// override the default sampler for the beeline | |
trace.GlobalConfig.SamplerHook = a.MakeSampler() |
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, |
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
package main | |
import ( | |
"fmt" | |
"os" | |
circleci "github.com/jszwedko/go-circleci" | |
) | |
func main() { |
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
# use UTF8 | |
# set -g utf8 | |
# set-window-option -g utf8 on | |
# make tmux display things in 256 colors | |
# set -g default-terminal "screen-256color" | |
set -g default-terminal "xterm-256color" | |
# set scrollback history to 30000 (30k) | |
set -g history-limit 30000 |
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
package main | |
import ( | |
"fmt" | |
"net/http" | |
"github.com/gorilla/mux" | |
) | |
func customersGetHandleFunc(w http.ResponseWriter, r *http.Request) { |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"runtime" | |
"time" | |
beeline "github.com/honeycombio/beeline-go" | |
libhoney "github.com/honeycombio/libhoney-go" |
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
// unpackDeepEvent takes a parsed body (straight from json) and returns the | |
// unmodified original or a copy with any nested maps turned into dotted keys. | |
// (eg `"headers": {"a":5,"b":3}` turns in to `"headers.a":5,"headers.b":3`). | |
// Additionally returns a flag saying whether nested json was present, and an | |
// int indicating the depth actually unpacked. | |
func unpackDeepEvent(raw map[string]interface{}, maxDepth int) (map[string]interface{}, bool, int) { | |
unpacked := make(map[string]interface{}, len(raw)) | |
nestedKeys := make(map[string]struct{}) | |
var actualDepth int | |
for k, v := range raw { |
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
package main | |
// source creates events as quickly as possible and sends them. Libhoney's queue | |
// quickly fills up and goroutine count stabalizes and it drops additional | |
// incoming events. | |
import ( | |
"context" | |
"fmt" | |
"runtime" |
NewerOlder