Socket
Book a DemoInstallSign in
Socket

yandex-cloud-monitoring-metrics

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yandex-cloud-monitoring-metrics

A library for sending metrics to yandex cloud monitoring

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
341
80.42%
Maintainers
1
Weekly downloads
 
Created
Source

yandex-cloud-monitoring-metrics

A library for sending metrics to yandex cloud monitoring.

API doc https://cloud.yandex.com/en/docs/monitoring/operations/metric/add.

Supported metric types

  • DGAUGE: shows the metric value at a certain point in time. For example, the amount of used RAM.
  • GAUGE: shows the metric value at a certain point in time.
  • COUNTER: shows the metric value that increases over time. For example, the number of days of service continuous running.
  • RATE: shows the change in the metric value over time. For example, the number of requests per second.

Getting started

Install

npm install yandex-cloud-monitoring-metrics

Usage

const metricsLogger = new YandexCloudMonitoringMetricsLogger(
  process.env.SERVICE_ACCOUNT_ID,
  process.env.ACCESS_KEY_ID,
  process.env.PRIVATE_KEY,
  process.env.FOLDER_ID
);

const metrics: IYandexMetricRequest = {
  metrics: [
    {
      name: 'performance.metric',
      type: YandexMetricType.GAUGE,
      value: 150,
      labels: {
        env: 'production',
        tag1: 'value1',
      },
    },
  ],
};

const { writtenMetricsCount, error } = await metricsLogger.writeMetrics(
  metrics
);

Keywords

yandex

FAQs

Package last updated on 05 Jul 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