Skip to content

About

Prometheus instrumentation library for Python applications

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

649 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus Python Client

CI CodeQL Security Scan Docker Publish License

The official Python client for Prometheus monitoring system.


Installation

pip install prometheus-client

This package is available on PyPI.


Quickstart

from prometheus_client import start_http_server, Counter
import time

# Create a metric to track request count
REQUESTS = Counter('hello_requests_total', 'Total HTTP requests.')

if __name__ == '__main__':
    # Start up the server to expose the metrics.
    start_http_server(8000)
    print("Metrics server started at http://localhost:8000/metrics")
    
    # Generate some metric activity.
    while True:
        REQUESTS.inc()
        time.sleep(1)

DevOps & Cloud-Native Observability

This repository includes enterprise-grade DevOps automation, containerization, and monitoring assets:

1. Local Observability Sandbox

Launch a complete local sandbox with the instrumented app, Prometheus, Grafana, and Alertmanager:

make compose-up

2. Kubernetes & Helm Deployment

Deploy the instrumented microservice to Kubernetes with built-in ServiceMonitor CRD support:

helm upgrade --install prometheus-python-app ./charts/prometheus-python-app \
  --namespace monitoring-apps \
  --create-namespace

3. Architecture & Operational Runbooks

Refer to DEVOPS.md for:

  • End-to-end CI/CD architecture diagrams
  • Multi-stage hardened Docker containerization guidelines
  • Multiprocess mode in-memory tmpfs configuration
  • Operational runbooks for incident response (TargetDown, HighErrorRate, HighLatencyP99, ProcessHighMemoryUsage)

Documentation & Links

About

Prometheus instrumentation library for Python applications

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages