forked from honeycombio/beeline-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
61 lines (61 loc) · 2.32 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Package beeline aids adding instrumentation to go apps using Honeycomb.
//
// Summary
//
// This package and its subpackages contain bits of code to use to make your
// life easier when instrumenting a Go app to send events to Honeycomb. Most
// applications will use something out of the `wrappers` package and the
// `beeline` package.
//
// The `beeline` package provides the entry point - initialization and the basic
// method to add fields to events.
//
// The `trace` package offers more direct control over the generated events and
// how they connect together to form traces. It can be used if you need more
// functionality (eg asynchronous spans, other field naming standards, trace
// propagation).
//
// The `propagation`, `sample`, and `timer` packages are used internally and not
// very interesting.
//
// The `wrappers` package contains middleware to use with other existing
// packages such as HTTP routers (eg goji, gorilla, or just plain net/http) and
// SQL packages (including sqlx and pop).
//
// Finally the `examples` package contains small example applications that use
// the various wrappers and the beeline.
//
// Regardless of which subpackages are used, there is a small amount of global
// configuration to add to your application's startup process. At the bare
// minimum, you must pass in your team write key and identify a dataset name to
// authorize your code to send events to Honeycomb and tell it where to send
// events.
//
// func main() {
// beeline.Init(beeline.Config{
// WriteKey: "abcabc123123defdef456456",
// Dataset: "myapp",
// })
// ...
//
// Once configured, use one of the subpackages to wrap HTTP handlers and SQL db
// objects.
//
// Examples
//
// There are runnable examples at
// https://github.com/honeycombio/beeline-go/tree/main/examples and examples
// of each wrapper in the godoc.
//
// The most complete example is in `nethttp`; it covers
// - beeline initialization
// - using the net/http wrapper
// - creating additional spans for larger chunks of work
// - wrapping an outbound http call
// - modifying spans on the way out to scrub information
// - a custom sampling method
//
// TODO create two comprehensive examples, one showing basic beeline use and the
// other the more exciting things you can do with direct access to the trace and
// span objects.
package beeline