Трафик 2 с Прометеем и Графаной - PullRequest
0 голосов
/ 04 апреля 2020

В настоящее время я использую Traefik 2.2 с Prometheus и Grafana. Панель мониторинга Traefik, метрики работают, и конечная точка Prometheus включена. Однако слишком мало показателей отправляется на панель управления Grafana. Надеюсь, кто-нибудь может дать некоторые предложения. Я пробовал с Prometheus: manualRouting: true и entryPoint: метрики, но тот же результат.

Заранее спасибо.

Метки Traefik:

  - "traefik.enable=true"
  - "traefik.http.routers.traefik.entrypoints=http"
  - "traefik.http.routers.traefik.entrypoints.rule=hostregexp('{host:.+}')"
  - "traefik.http.routers.traefik-secure.entrypoints=https"
  - "traefik.http.routers.traefik.rule=Host(`traefik.abcdxyz.com`) && PathPrefix(`/api`, `/dashboard`)"
  - "traefik.http.middlewares.traefik-auth.basicauth.users=tx7:$redacted$$"
  - "traefik.http.routers.traefik.middlewares=https-redirect@file"
  - "traefik.http.routers.traefik-secure.rule=Host(`traefik.abcdxyz.com`)"
  - "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
  - "traefik.http.routers.traefik-secure.tls=true"
  - "traefik.http.routers.traefik-secure.tls.certresolver=le"
  - "traefik.http.routers.traefik-secure.service=api@internal"
  - "traefik.http.services.traefik.loadbalancer.server.port=8080"
  - "traefik.http.routers.traefik-secure.tls.options=myTLS@file"

Traefik.yml

log:
  level: INFO

entryPoints:
  dashboard:
    address: :8080
  http:
    address: :80
  https:
    address: :443
  metrics:
    address: :8082

api:
  dashboard: true
  insecure: false
  debug: true

serversTransport:
  insecureSkipVerify: true

certificatesResolvers:
  le:
    acme:
      httpChallenge:
        # used during the challenge
        entryPoint: http
      email: abcd@outlook.com
      storage: acme.json
      # Use Let's Encrypt Staging CA when testing!
      #caServer: https://acme-staging-v02.api.letsencrypt.org/directory

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false
  file:
    filename: config.yml
    watch: true

accessLog: {}

# metrics

metrics:
  prometheus:
   manualRouting: true
    buckets:
      - 0.1
      - 0.3
      - 1.2
      - 5.0
    addEntryPointsLabels: true
    addServicesLabels: true

  influxdb:
    pushInterval:
     - "10s"
    addEntryPointsLabels: true
    addServicesLabels: true
    protocol: http
    database: server
    username: admin
    password: "passwd."

config.yml

http:
  routers:
    api:
      entryPoints:
        - metrics
      rule: PathPrefix(`/metrics`)
      service: prometheus@internal

Prometheus.yml

global:
  scrape_interval: 5s
  external_labels:
    monitor: 'server'
scrape_configs:
  - job_name: 'prometheus'
    static_configs:
    - targets: ['192.168.1.97:9090']
  - job_name: 'node_exporter'
    static_configs:
    - targets: ['192.168.1.97:9100']

  - job_name: 'traefik'
    static_configs:
    - targets: ['192.168.1.97:8082']

  - job_name: 'grafana'
    static_configs:
    - targets: ['192.168.1.97:3000']
...