Skip to main content

MetricsGPT is a tool for generating PromQL queries from natural language queries. Talk to your metrics!

Project description

metricsGPT

Talk to your metrics.

Demo

[!NOTE]

This is a work in progress with no API guarantees. The current implementation needs work on scalability.

Installation

Ensure you have Python 3.12+ and Node v20+ locally .

By default this tool uses llama3 and nomic-embed-text.

ollama pull llama3
ollama pull nomic-embed-text

After cloning run,

make venv
source venv/bin/activate
pip3 install -r requirements.txt

Have some local prometheus up and running. You can use make run-prom to get one running in docker that scrapes itself.

Finally run,

python3 run metricsGPT.py --server

and visit localhost:8081!

## Configuration

Edit config.yaml to suit your own models/Prometheus/Thanos setups.

# Prometheus Configuration
prometheus_url: "http://localhost:9090"
# prometheus_auth:
#   # Basic authentication
#   basic_auth:
#     username: "your_username"
#     password: "your_password"
  
#   # Or Bearer token
#   bearer_token: "your_token"
  
#   # Or custom headers
#   custom_headers:
#     Authorization: "Custom your_auth_header"
#     X-Custom-Header: "custom_value"
  
#   # TLS/SSL configuration
#   tls:
#     cert_file: "/path/to/cert.pem"
#     key_file: "/path/to/key.pem"
#     skip_verify: false  # Set to true to skip 

prom_external_url: null  # Optional external URL for links in the UI
query_lookback_hours: 1.0

# Storage Configuration
vectordb_path: "./data.db"
series_cache_file: "./series_cache.json"

# Server Configuration
refresh_interval: 900  # VectorDB Refresh interval in seconds 
server_host: "0.0.0.0"
server_port: 8081

# LLM Configuration
llm:
  provider: "ollama"
  model: "llama3.1"

embedding:
  provider: "ollama"  # or "openai"
  model: "nomic-embed-text"
  dimension: 768 # optional, defaults to this dimension

# For Azure OpenAI embeddings:
#embedding:
#  provider: "azure"
#  model: "text-embedding-ada-002"
#  deployment_name: "your-embedding-deployment"
#  api_key: "your-api-key"
#  endpoint: "your-azure-endpoint"
#  api_version: "2023-05-15"  
#  dimension: "dimensions of model"

# For Watson embeddings:
#embedding:
#  provider: "watsonx"
#  api_key: "your-api-key"
#  project_id: "your-project-id"
#  model_id: "google/flan-ul2"  # optional, defaults to this model
#  dimension: "dimensions of model"

# For OpenAI embeddings:
#embedding:
#  provider: "openai"
#  model: "text-embedding-ada-002"
#  api_key: "your-api-key"
#  dimension: "dimensions of model"

# Example configurations for different providers:

# For OpenAI:
#llm:
#  provider: "openai"
#  model: "gpt-4"
#  api_key: "your-api-key"

# For Ollama:
#llm:
#  provider: "ollama"
#  model: "metricsGPT"
#  timeout: 120.0

# For Azure:
#llm:
#  provider: "azure"
#  model: "gpt-4"
#  deployment_name: "your-deployment"
#  api_key: "your-api-key"
#  endpoint: "your-azure-endpoint"

# For Gemini:
#llm:
#  provider: "gemini"
#  model: "gemini-pro"
#  api_key: "your-api-key"

# For WatsonX:
#llm:
#  provider: "watsonx"
#  api_key: "your-api-key"
#  project_id: "your-project-id"
#  model_id: "your-model-id"

TODOs:

  • Much more efficient vectorDB ops
  • Use other Prom HTTP APIs for more context
  • Range queries
  • Visualize
  • Embed query results for better analysis
  • Process alerts

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

metricsgpt-0.2.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metricsgpt-0.2.0-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file metricsgpt-0.2.0.tar.gz.

File metadata

  • Download URL: metricsgpt-0.2.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.13.1 Darwin/23.6.0

File hashes

Hashes for metricsgpt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0bc8563c62ea7523ba1ad178242655dd6a243cb0a8920aebe946c6f027d425e3
MD5 a4a0a823c15199fc711f7b4ffa1e2890
BLAKE2b-256 dabe746862d775d1e3aa62550d77ded98bfdff2eec15a1505839356b7479d363

See more details on using hashes here.

File details

Details for the file metricsgpt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: metricsgpt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.13.1 Darwin/23.6.0

File hashes

Hashes for metricsgpt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51a651bf05835c8abf7d5f6f8e467f57068a0bc9b7c7a6a77d5226ec82781a14
MD5 65114d1392f56051153c3a65f29e5338
BLAKE2b-256 878e9aaeb125c0ed124575a899535cd0f452da09d27f543b2f77b1efa2511420

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