Skip to main content

Simple library for send metric into pushgateway

Project description

Python3 pushgateway library

About

Python3 library with functions for sending metrics to Pushgateway.

Install

pip install pflib

Usage

Metric:

Function Args needed Description
added_label label(dict), value(any, only is decimal) Added metric.
send none Sends metrics from temporary file to Pushgateway and deletes the file afterwards.
validate_metric none This functions use to validate metric.
__init__ name, type, help, script_name(job) Initializing metric. Type - all str.
__str__ none Printing metric in pushgateway format.

Examples

Please check example.py

How to use

Edit metric

import os

from pflib import metric

file_name = os.path.basename(__file__)

my_metric = metric("metric:name1", "counter", "helpMetric", file_name)
print(my_metric.name)

# Printing - metric:name1

my_metric.name = "example"
print(my_metric.name)

# Printing - example

# For more check pls pf.py def __init__

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pflib-0.0.2.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file pflib-0.0.2.tar.gz.

File metadata

  • Download URL: pflib-0.0.2.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for pflib-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7801d704fb2fae4144a17b5347464300e6c24634316051ad3269af57f322c05a
MD5 0bbdece3907d8827108acc213cb715a2
BLAKE2b-256 f893a10f0e0645bd9b44a17db49cd60c314e2a168345c56c334340e8904186c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page