Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@lidofinance/api-metrics
Advanced tools
Readme
Utils to work with common API metrics
yarn add @lidofinance/api-metrics
Just call it in the same place where you call collectDefaultMetrics
.
import { Registry, collectDefaultMetrics } from 'prom-client';
import getConfig from 'next/config';
import { METRICS_PREFIX } from 'config';
import buildInfoJson from 'build-info.json';
import { collectStartupMetrics } from '@lidofinance/api-metrics';
const { publicRuntimeConfig } = getConfig();
const { defaultChain, supportedChains } = publicRuntimeConfig;
export const registry = new Registry();
collectStartupMetrics({
prefix: METRICS_PREFIX,
registry,
defaultChain,
supportedChains: supportedChains.split(','),
version: process.env.npm_package_version ?? 'unversioned',
commit: buildInfoJson.commit,
branch: buildInfoJson.branch,
});
collectDefaultMetrics({ prefix: METRICS_PREFIX, register: registry });
It's mostly internal util for @lidofinance/api-rpc and @lidofinance/eth-api-providers, but you should use it if you use RPC requests in some other way.
Take a look into the file itself to view exported metrics, it's quite simple.
There is a list of utils, which helps to reduce cardinality, e.g. you should collect '2xx' instead of '200', '201', ... and other HTTP response statuses, because in most cases it doesn't matter.
FAQs
Utils to work with common API metrics
The npm package @lidofinance/api-metrics receives a total of 102 weekly downloads. As such, @lidofinance/api-metrics popularity was classified as not popular.
We found that @lidofinance/api-metrics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.