opencensus-go icon indicating copy to clipboard operation
opencensus-go copied to clipboard

Add tag.MustNewKey

Open fabxc opened this issue 6 years ago • 1 comments

Currently one needs to declare tag keys in a var block and then initialize them in an init function. This adds a fair amount of boilerplate just for instrumentation.

Adding a tag.MustNewKey function that panics on invalid keys would allow to define new keys in a single line. The only sane option if tag.NewKey returns an error is exiting the program immediately anyway it seems. So effective program behavior wouldn't be altered.

fabxc avatar Mar 20 '19 05:03 fabxc

Addressed by #1141

semistrict avatar Jun 13 '19 01:06 semistrict