keylightexporter

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2022 License: MIT Imports: 12 Imported by: 0

README

keylight_exporter Linux Test Status Go Report Card

Command keylight_exporter implements a Prometheus exporter for Elgato Key Light devices. MIT Licensed.

Configuration

The keylight_exporter's Prometheus scrape configuration (prometheus.yml) is configured in a similar way to the official Prometheus blackbox_exporter.

The targets list under static_configs should specify the addresses of any keylight devices which should be monitored by the exporter. The address of the keylight_exporter itself must be specified in relabel_configs as well.

scrape_configs:
  - job_name: 'keylight'
    static_configs:
      - targets:
        - '192.168.1.10' # keylight device.
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: '127.0.0.1:9288' # keylight_exporter.

Documentation

Overview

Package keylightexporter implements a Prometheus exporter for Elgato Key Light devices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(reg *prometheus.Registry, f Fetcher) http.Handler

NewHandler returns an http.Handler that serves Prometheus metrics for Key Light devices. The Fetcher's Fetch method specifies how to connect to a device with the specified address on each HTTP request. If f is nil, a default HTTP fetcher will be used.

Each HTTP request must contain a "target" query parameter which indicates the network address of the device which should be scraped for metrics. If no port is specified, the Key Light device default of 9123 will be used.

Types

type Data

type Data struct {
	Device *keylight.Device
	Lights []*keylight.Light
}

Data contains information which is used to export Prometheus metrics.

type Fetcher

type Fetcher interface {
	Fetch(ctx context.Context, addr string) (*Data, error)
}

A Fetcher can fetch Data about a Key Light device from addr.

Directories

Path Synopsis
cmd
keylight_exporter
Command keylight_exporter implements a Prometheus exporter for Elgato Key Light devices.
Command keylight_exporter implements a Prometheus exporter for Elgato Key Light devices.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL