skywalking/plugins/sw_psycopg.py [71:99]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            dsn = self.connection.info.get_parameters()
            port = self.connection.info.port
            peer = f"{dsn['host']}:{str(port)}"

            with get_context().new_exit_span(op='PostgreSQL/Psycopg/executemany', peer=peer,
                                             component=Component.Psycopg) as span:
                span.layer = Layer.Database

                span.tag(TagDbType('PostgreSQL'))
                span.tag(TagDbInstance(dsn['dbname']))
                span.tag(TagDbStatement(query))

                if config.plugin_sql_parameters_max_length:
                    max_len = config.plugin_sql_parameters_max_length
                    total_len = 0
                    text_list = []

                    for vars in vars_list:
                        text = f"[{','.join(str(v) for v in vars)}]"
                        total_len += len(text)

                        if total_len > max_len:
                            text_list.append(f'{text[:max_len - total_len]}...')

                            break

                        text_list.append(text)

                    span.tag(TagDbSqlParameters(f"[{','.join(text_list)}]"))
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



skywalking/plugins/sw_psycopg.py [186:214]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            dsn = self.connection.info.get_parameters()
            port = self.connection.info.port
            peer = f"{dsn['host']}:{str(port)}"

            with get_context().new_exit_span(op='PostgreSQL/Psycopg/executemany', peer=peer,
                                             component=Component.Psycopg) as span:
                span.layer = Layer.Database

                span.tag(TagDbType('PostgreSQL'))
                span.tag(TagDbInstance(dsn['dbname']))
                span.tag(TagDbStatement(query))

                if config.plugin_sql_parameters_max_length:
                    max_len = config.plugin_sql_parameters_max_length
                    total_len = 0
                    text_list = []

                    for vars in vars_list:
                        text = f"[{','.join(str(v) for v in vars)}]"
                        total_len += len(text)

                        if total_len > max_len:
                            text_list.append(f'{text[:max_len - total_len]}...')

                            break

                        text_list.append(text)

                    span.tag(TagDbSqlParameters(f"[{','.join(text_list)}]"))
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



