This plugin automatically instruments the pg module.

interface pg {
    appendComment?: boolean;
    dbmPropagationMode?: string;
    enabled?: boolean;
    measured?: boolean | {
        [key: string]: boolean;
    };
    service?: string | ((params) => string);
}

Hierarchy

  • Instrumentation
    • pg

Properties

appendComment?: boolean

Appends the SQL comment propagation to the query string. Prepends the comment if false. For long query strings, the appended propagation comment might be truncated, causing loss of correlation between the query and trace.

dbmPropagationMode?: string

The database monitoring propagation mode to be used for this plugin.

enabled?: boolean

Whether to enable the plugin.

Default

true
measured?: boolean | {
    [key: string]: boolean;
}

Whether to measure the span. Can also be set to a key-value pair with span names as keys and booleans as values for more granular control.

Type declaration

  • [key: string]: boolean
service?: string | ((params) => string)

The service name to be used for this plugin. If a function is used, it will be passed the connection parameters and its return value will be used as the service name.

Type declaration

    • (params): string
    • Parameters

      • params: any

      Returns string