hyperhq / faas-hyper

Enable Hyper.sh as a backend for OpenFaaS (Functions as a Service) https://github.com/alexellis/faas
MIT License
22 stars 1 forks source link

Integrate metrics via Prometheus #2

Closed alexellis closed 7 years ago

alexellis commented 7 years ago

Suggested docker-compose.yml config to get this working is below:

version: '2'
services:
  faas-hyper:
    image: imeoer/faas-hyper
    hostname: faas-hyper
    environment:
      - HYPER_ACCESS_KEY=key
      - HYPER_SECRET_KEY=secret
    ports:
      - 8080:8080
    restart: always

  prometheus:
    hostname: prometheus
    image: alexellis2/prometheus-hyper
    command: "-config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -storage.local.memory-chunks=10000"
    ports:
      - 9090:9090

  gateway:
    image: functions/gateway:collated_stats_pr
    hostname: gateway
    environment:
      - functions_provider_url=http://faas-hyper:8080/
      - faas_prometheus_host=prometheus
    depends_on:
      - faas-hyper
      - prometheus
    ports:
      - 8080:8080
    fip: fip_ip
    restart: always
alexellis commented 7 years ago

This will need a new Dockerfile putting together for Prometheus where it "scrapes" the address "gateway" instead of "gateway.tasks" or "gateway.default" (k8s config)

https://github.com/alexellis/faas/blob/master/prometheus/prometheus.yml#L34

Temporary image: alexellis2/prometheus-hyper

imeoer commented 7 years ago

@alexellis Thanks for the instruction and building the image, I will Integrate it.

imeoer commented 7 years ago

@alexellis Integrated in 7a021f1481eec0a83e42e4db1c43cc68eb949138