honeycombio / libhoney-go

Go library for sending data to Honeycomb
Apache License 2.0
58 stars 40 forks source link

feat: include Go version, GOOS, & GOARCH in user-agent #207

Closed robbkidd closed 1 year ago

robbkidd commented 1 year ago

Which problem is this PR solving?

It helps Honeycomb support customers to know what operating systems and CPU architectures instrumentation is running upon. OpenTelemetry has added this to the Collector and the spec for Exporters and we have prior art for this in libhoney-rb.

Short description of the changes

lizthegrey commented 1 year ago

We may need to check that this won't break any Boards, Derived Columns, Triggers, or Saved Queries in dogfood. @cartermp

robbkidd commented 1 year ago

One option to avoid current user-agent parsing expectations is to put (OS/ARCH) at the end of the user-agent string. That was opted for when adding the Ruby version, OS, and architecture in libhoney-rb.

Instead of:

libhoney-go/1.2.3 (linux/amd64) fancyApp/3

… it could be …

libhoney-go/1.2.3 fancyApp/3 (linux/amd64)

… 🤔 or even include runtime.Version():

libhoney-go/1.2.3 fancyApp/3 (go1.19.1 linux/amd64)
lizthegrey commented 1 year ago

+1 just use runtime.Version()

robbkidd commented 1 year ago

Current state, it will look like libhoney-go/1.2.3 fancyApp/3 go/1.19.1 (linux/amd64), transforming runtime.Version() "go1.9.1" into something that looks more like user-agent formatting "go/1.9.1".