Giter Site home page Giter Site logo

hetzner-load-balancer-prometheus-exporter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hetzner-load-balancer-prometheus-exporter's Issues

Couldnt get field 'NoneType' object is not subscriptable

Hello,

I started your exporter with docker-compose:

  hetzner-load-balancer-prometheus-exporter:
    image: wacken/hetzner-load-balancer-prometheus-exporter:latest
    container_name: hetzner-lb
    expose:
            - 8000
    environment:
            - LOAD_BALANCER_IDS="<id redacted>,<id redacted>"
            - ACCESS_TOKEN="${HETZNER_API_TOKEN_READ}"

but it shows the following logs, I'm not sure if it's an "expected" message ?

hetzner-lb  | 2022-06-30T16:11:30.498488714Z Hetzner Load Balancer Exporter is starting ...
hetzner-lb  | 2022-06-30T16:11:30.498507667Z Getting Info from Hetzner ...
hetzner-lb  | 2022-06-30T16:11:30.498510184Z
hetzner-lb  | 2022-06-30T16:11:30.498511842Z Found Load Balancers
hetzner-lb  | 2022-06-30T16:11:30.536478067Z Couldnt get field 'NoneType' object is not subscriptable

Thanks in advance for your help !

Docker-Image support for arm64 arch

Depending on the support status of this project, would you consider adding support for the arm64 arch?

It would be awesome since Hetzner added support for arm64 a couple of months ago. This would allow users allow to run the image on any hetzner server/VM.

My usecase:
I run a mixed arch k8s cluster. I recently had the problem that the scheduler scheduled the pod on a arm64 node which could not run the current image. And since your implementation is pure python (no compiled and linked c libs) this would only require adding the plattform prob in the GitHub Action CI file.

[Idea] Add service/target status

Hi @wacken89 ,

First let me thank you for this great project!
I would like to place an idea/feature request. Would it be possible to add metrics (probably Gauges) to show the health status of the services (or service targets). If I understood the Hetzner API documentation, there should be a health state available via API.

Best regards,
Raffael

Support for secret files

It would be great to be able to pass the API token as a file instead of an environment variable, using secret mounts in Docker swarm, for example. This could be implemented by allowing to set the API_TOKEN_FILE environment variable to a path of a file containing the actual token; the code would need to check whether that variable is set and points to a readable file, then read that; otherwise, fall back to the API_TOKEN environment variable.
If you're interested, I'm happy to send a PR!

Interrupt scrape data

Hello, I'm trying to use your exporter, but it doesn't work correctly for me.

I installed the latest version of the exporter in the Kubernetes cluster, added 2 dashboards and set the system requirements to default. For a period of time he worked. But after a few hours, my graphs for all load balancers began to show breaks.

Screenshot 2022-09-29 at 12 32 40

I found errors in the pod:
error_of_pod
error_of_pod2

As far as I understand, errors when trying to get data from the cloud and the name of the metrics can be different.

I tried to use the previous version 1.1.0, but it didn't help.
I tried to raise the system characteristics and it did not help either.
Then I decided to create another pod with an exporter and they started to fall at the same time.
I also tried setting different "SCRAPE_INTERVAL" times, but that didn't help either.

Deployment config:
apiVersion: apps/v1
kind: Deployment
metadata:
name: hetzner-load-balancer-prometheus-exporter
labels:
app: hetzner-load-balancer-prometheus-exporter
spec:
replicas: 1
selector:
matchLabels:
app: hetzner-load-balancer-prometheus-exporter
template:
metadata:
labels:
app: hetzner-load-balancer-prometheus-exporter
annotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '8000'
prometheus.io/path: '/'
spec:
containers:
- name: exporter
image: wacken/hetzner-load-balancer-prometheus-exporter:latest
env:
- name: LOAD_BALANCER_IDS
value: "id"
- name: ACCESS_TOKEN
value: "token"
- name: SCRAPE_INTERVAL
value: '60'
resources:
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "250m"
ports:
- containerPort: 8000

LoadBalancer Config:
"id": <id_lb>>,
"name": "load_balancer1",
"public_net": {
"enabled": false,
"ipv4": {
"ip": "<ip_address>",
"dns_ptr": "static.<ip_address>.clients.your-server.de"
},
"ipv6": {
"ip": "<ip_address>",
"dns_ptr": ""
}
},
"private_net": [
{
"network": <id_network>,
"ip": "<ip_address>"
}
],
"location": {
"id": 2,
"name": "nbg1",
"description": "Nuremberg DC Park 1",
"country": "DE",
"city": "Nuremberg",
"latitude": 49.452102,
"longitude": 11.076665,
"network_zone": "eu-central"
},
"load_balancer_type": {
"id": 1,
"name": "lb11",
"description": "LB11",
"max_connections": 10000,
"max_services": 5,
"max_targets": 25,
"max_assigned_certificates": 10,
"deprecated": null,
"prices": [
{
"location": "hel1",
"price_hourly": {
"net": "0.0088000000",
"gross": "0.0096000000"
},
"price_monthly": {
"net": "5.3900000000",
"gross": "5.88000000"
}
},
{
"location": "ash",
"price_hourly": {
"net": "0.0088000000",
"gross": "0.0096000000"
},
"price_monthly": {
"net": "5.3900000000",
"gross": "5.88000000"
}
},
{
"location": "nbg1",
"price_hourly": {
"net": "0.0088000000",
"gross": "0.0096000000"
},
"price_monthly": {
"net": "5.3900000000",
"gross": "5.88000000"
}
},
{
"location": "fsn1",
"price_hourly": {
"net": "0.0088000000",
"gross": "0.0096000000"
},
"price_monthly": {
"net": "5.3900000000",
"gross": "5.88000000"
}
}
]
},
"protection": {
"delete": false
},
"labels": {
"env": "",
"name": "",
"project": "",
"created_by": "terraform",
"full_project_name": ""
},
"created": "2022-03-29T09:35:24Z",
"services": [
{
"protocol": "tcp",
"listen_port": 9000,
"destination_port": 9000,
"proxyprotocol": false,
"health_check": {
"protocol": "tcp",
"port": 9000,
"interval": 15,
"timeout": 10,
"retries": 3
}
},
{
"protocol": "tcp",
"listen_port": 8123,
"destination_port": 8123,
"proxyprotocol": false,
"health_check": {
"protocol": "tcp",
"port": 8123,
"interval": 15,
"timeout": 10,
"retries": 3
}
}
],
"targets": [
{
"type": "server",
"server": {
"id":
},
"health_status": [
{
"listen_port": 9000,
"status": "healthy"
},
{
"listen_port": 8123,
"status": "healthy"
}
],
"use_private_ip": true
},
{
"type": "server",
"server": {
"id":
},
"health_status": [
{
"listen_port": 9000,
"status": "healthy"
},
{
"listen_port": 8123,
"status": "healthy"
}
],
"use_private_ip": true
},
{
"type": "server",
"server": {
"id":
},
"health_status": [
{
"listen_port": 9000,
"status": "healthy"
},
{
"listen_port": 8123,
"status": "healthy"
}
],
"use_private_ip": true
},
{
"type": "server",
"server": {
"id":
},
"health_status": [
{
"listen_port": 9000,
"status": "healthy"
},
{
"listen_port": 8123,
"status": "healthy"
}
],
"use_private_ip": true
},
{
"type": "server",
"server": {
"id":
},
"health_status": [
{
"listen_port": 9000,
"status": "healthy"
},
{
"listen_port": 8123,
"status": "healthy"
}
],
"use_private_ip": true
},
{
"type": "server",
"server": {
"id":
},
"health_status": [
{
"listen_port": 9000,
"status": "healthy"
},
{
"listen_port": 8123,
"status": "healthy"
}
],
"use_private_ip": true
}
],
"algorithm": {
"type": "round_robin"
},
"outgoing_traffic": 0,
"ingoing_traffic": 2205000,
"included_traffic": 21990232555520
},
{

Could you help me to solve the problem? Thanks a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.