Closed robbkidd closed 1 year ago
We may need to check that this won't break any Boards, Derived Columns, Triggers, or Saved Queries in dogfood. @cartermp
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)
+1 just use runtime.Version()
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".
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
Updated the user-agent to include Go version, GOOS, and GOARCH
Makefile addition with a test target to bring the CI test execution mechanism up-to-date with what we're doing in other Go codebases to make it easy to run the tests, make it each to read the test output, and give CI the data it needs to helps us see test failures more clearly.
Moved our libhoney version declaration out of the parent libhoney package and into version so that other packages (transmission) can reference it. That allows the usual user-agent to be pre-computed.
User-agent assertions updated to use testify because the failure output for diffs is so much friendlier.