🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@metis-data/base-interceptor

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metis-data/base-interceptor

Utils for metis packages for query interception

Source
npmnpm
Version
2.3.21
Version published
Weekly downloads
24
200%
Maintainers
1
Weekly downloads
 
Created
Source

@metis-data/base-interceptor

Utils for building an interceptor.

Configuration

Merge interceptor configuration from code (e.g. from developer), environment and builtin default.

import {
  Configuration,
  ConfigurationHandler,
} from '@metis-data/base-interceptor';

const config = { serviceName: 'test' };

const mergedConfig = ConfigurationHandler.getMergedConfig(config);

Span

Mark a Span

Mark a span as tracked by Metis. Only Spans with this tag would be exported to Metis' server (assuming MetisRemoteExporter is used).

import { markSpan } from '@metis-data/base-interceptor';

markSpan(span);

Get Query from Span

Extract a query from a span using the common db related attributes.

import { getQueryFromSpan } from '@metis-data/base-interceptor';

const query = getQueryFromSpan(span);

Attach Trace Id To Query

Adds the trace and span id to SQL query.

Example: SELECT * FROM table /traceparent=traceId-spanId**/

import { attachTraceIdToQuery } from '@metis-data/base-interceptor';

attachTraceIdToQuery(span);

Add Plan To Span

Add a given plan Object to a given span.

import { addPlanToSpan } from '@metis-data/base-interceptor';

addPlanToSpan(span, plan);

FAQs

Package last updated on 22 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts