Closed gvencadze closed 1 year ago
Hi @gvencadze , please take a look at this template: https://github.com/hexdigest/gowrap/blob/master/templates/elasticapm
maybe it's what you need.
@hexdigest o_O, I've created this merge request 3 week earlier.
Btw, there's a bug while call _d.captureError()
- we must call Send() method to send error to APM system, otherwise it won't be sent.
Also span type is incorrect - they should have names like "http", "db", "external", "internal" and not interface name, I'll suggest this changes in another MR, okay?
Consider the opportunity by the naming of the span, using opt function pattern, which in turn allows you to either use the base type or set the name manually
@gvencadze, thanks for the note about the Send() call, I'll fix it now.
@bars43ru
I'll suggest to avoid setting each parameter from function to labels, better add them via opt function
@gvencadze It looks like really use/not use 'SetLable' can be controlled through opt function. This will allow for a more general pattern.
a little later I will prepare an MR with the ability to manage the use SetLabel via opt function
@bars43ru you can tag me in MR - I've some experience with elastic apm, maybe I'll suggest anything else to make template better
Adds support for Elastic APM traces.
(didn't include tests)