You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I'm using pg-promise and I'm facing issue with using two databases, similar to #317. I have two separate connections and no matter what I do it's always under the same service name ${tracer._service}-postgres. So far I was trying to do: DD_SERVICE_NAME = 'api'
first ddPgServiceName = 'main'
second ddPgServiceName = 'micro'
const initOptions = {
promiseLib: Promise,
extend: obj => {
obj.traceableOne = (query, values) => {
const service = tracer._tracer._service
tracer._tracer._service = ddPgServiceName
one = obj.one(query, values)
tracer._tracer._service = service
return one
}
}
But in DD it's always api-postgres (also it wraps tcp and dns services which is bad and should be only focused on query)
Any idea what I'm missing? I know that it should be done as close as possible to query function.
The text was updated successfully, but these errors were encountered:
In order to do this without relying on the tracer internals, the best approach would be to add support for this directly to the tracer. We've been thinking about adding a splitByInstance option to database integrations. Are main and micro the instance names? Would that fit your use case?
It would be awesome to splitByInstance and pass true or object with 'instanceName': 'newServiceName'. This way it will allow to bind all services properly.
Hey, I'm using pg-promise and I'm facing issue with using two databases, similar to #317. I have two separate connections and no matter what I do it's always under the same service name
${tracer._service}-postgres
. So far I was trying to do:DD_SERVICE_NAME = 'api'
first ddPgServiceName = 'main'
second ddPgServiceName = 'micro'
But in DD it's always api-postgres (also it wraps tcp and dns services which is bad and should be only focused on query)
Any idea what I'm missing? I know that it should be done as close as possible to
query
function.The text was updated successfully, but these errors were encountered: