cloud-trace-nodejs icon indicating copy to clipboard operation
cloud-trace-nodejs copied to clipboard

Support pg v8

Open seeARMS opened this issue 4 years ago • 10 comments

Trace doesn't work with the newest pg major release (v8). It would be great to add support for this, as currently the lib only works with versions 6-7.

seeARMS avatar Jun 01 '20 22:06 seeARMS

It seems that the current logic of pg v7 plugin can be used with v8 directly.

rueian avatar Jun 03 '20 09:06 rueian

TODO:

  • [ ] Add v8 support
  • [ ] Make sure v8 is tested
  • [ ] Evaluate how well pg in general and pg v8 is supported in OpenTelemetry, and open tickets where appropriate

kintel avatar Jun 08 '20 15:06 kintel

Here's a hack to enable the v7 pg plugin on pg v8. Use at your own peril.

for (const patch of require('@google-cloud/trace-agent/build/src/plugins/plugin-pg')) {
  if (patch.versions === '^7.x') {
    patch.versions = '^7.x || ^8.x';
  }
}

danvk avatar Dec 10 '20 18:12 danvk

How can we progress this pull request?

weyert avatar Jan 22 '21 12:01 weyert

Looking at the actual changelog the only reason it went from v7 to v8 is because node 6 support was dropped: https://github.com/brianc/node-postgres/blob/master/CHANGELOG.md#pg800

It should be really quick to just add 8.x to the versions list. I would send a PR but I'm having a hard time wrapping my head around how the testing and build process works for this project, especially with the typings setup (Where do these files come from? https://github.com/googleapis/cloud-trace-nodejs/blob/master/src/plugins/types/index.d.ts#L34)

Will look again later today using https://github.com/googleapis/cloud-trace-nodejs/commit/f070636eb4ed9adb3f59c55e354913915f495f1e as a template

yocontra avatar Feb 24 '21 19:02 yocontra

@contra thanks for taking a look, I'll bring this issue up internally as well, see if I can get anyone's 👀 on it.

bcoe avatar Mar 13 '21 00:03 bcoe

Hey @bcoe any good news on this?

Zorato avatar May 18 '21 15:05 Zorato

@Zorato unfortunately no updates, @kintel do you know who a good person to loop in would be?

bcoe avatar May 21 '21 00:05 bcoe

@jarek-dudek @gkf Could you follow up on this?

kintel avatar May 21 '21 00:05 kintel

Sorry I don't have much to add. This is effectively on our backlog currently.

gkf avatar May 29 '21 23:05 gkf

We don't expect to be able to add pg v8 support to the Cloud Trace NodeJS agent any time soon.

Please consider using OpenTelemetry instead -- @opentelemetry/instrumentation-pg supports pg v8.x.

punya avatar Aug 28 '22 23:08 punya

@punya does this mean cloud-trace-nodejs is deprecated, and people should generally be switching to a different approach, like OpenTelemetry, for sending traces to Google Cloud Trace from node backends?

yasha-spare avatar Sep 02 '22 18:09 yasha-spare

Hi @yasha-spare, thanks for the question - it's a reasonable one.

Cloud-trace-nodejs will continue to fix bugs and add security patches. We will consider merging new feature contributions (depending on the anticipated maintenance cost). But we won't develop new features ourselves.

To your larger question: yes, we recommend that new codebases start out with OTel. Existing users of cloud-trace-nodejs need to make a more nuanced decision about when their library dependencies will no longer be supported by cloud-trace-nodejs.

We intend to add documentation (a migration guide) to help with this process.

punya avatar Sep 02 '22 23:09 punya

Cool, thanks for the swift reply/clarification @punya !

yasha-spare avatar Sep 03 '22 00:09 yasha-spare