Skip to content

pg tracing fails when used with pg-copy-streams #3314

Closed
@boennemann

Description

@boennemann

Package + Version

  • @sentry/browser
  • @sentry/node
  • @sentry/tracing
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

6.2.1

Description

When using pg together with pg-copy-streams the tracing code breaks the operation.

orig.call(...).then is not a function

https://github.com/getsentry/sentry-javascript/blob/master/packages/tracing/src/integrations/postgres.ts#L66

import pg from "pg"
import { to } from "pg-copy-streams"

const client = new pg.Client()

const query = `COPY (SELECT xxx FROM yyy to STDOUT (DELIMITER ';', FORMAT CSV, ENCODING 'UTF8')`

const dataStream: Readable = client.query(to(query))
>>> fails

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions