Integration with ES APM and routes logic


Looking for a way to wrap the client by a code (go sdk v1.6.7) that will report ops metrics to ES APM.
Looking at the sdk docs, all i found is a sample of using the thresholdtracer. In theory i can provide the cluster.SetTracer method an instance of apmot tracer ( but the problem with that is that I’m loosing the request context.

I want my tracer to create a new span on every Couchbase op but still maintains my transactions context - a new one is created on every call to one of my server’s routes.

any advise?


@brett19 can you assist ?

Hi @shaike.marc if I understand correctly you want to pass your span context into each of the SDK operations? Unfortuntely that is not possible with the 1.x series of the SDK. The way that the API was designed (many years ago) makes this difficult to support. The 2.x series of the SDK will support doing this but does not right now, it’s on our roadmap. The reason for this is that we have been waiting for OpenTelemetry to make a GA release (the Golang API is still on version 0.6 at the moment) before we expose support via our API.

@chvck, correct, that’s was my intention, pass my own ctx to the sdk. digging around the sdk code i realized there is no opt to pass it in so i had to wrap all the sdk - bucket ops - with my own go code.

Thanks, will wait for 2.x series.