Socket
Book a DemoInstallSign in
Socket

anmol_2_cortex_client_ruby

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anmol_2_cortex_client_ruby

0.1.0
bundlerRubygems
Version published
Maintainers
2
Created
Source

Cortex Client

[![Build Status] (https://github.com/anmol1vw13/cortex-client-ruby/workflows/Push%20Cortex%20Client/badge.svg?branch=master)]

About

It is a ruby library to push timeseries metrics to cortex.

Prerequisites

ruby - 2.5.0

Usage

Step1: Configure the client

CortexClient.configure do |config|
   config.host = '<host>'
   config.metrics_push_api_path = '<metrics-api>'
   config.token = "sample_token"
end

Step2: Push a timeseries based metric

metric = CortexClient::Metric.new('test_usage')
response = metric.
     add_label(name: "label1", value: "value1").
     add_label(name: "label2", value: "value2").add_sample(value: 1).push

The metric instance has the error appended if there's any and if there's no error, then the instance 
has a prom_message in it.

FAQs

Package last updated on 19 Feb 2021

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.