deucalion

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package deucalion provides an easy-to-use Prometheus metrics server.

The deucalion package provides an automatic Prometheus server that will start automatically when the PROMETHEUS_ADDRESS environment variable is set. To use the deucalion package only for the automatic metrics server, you may import it as:

import _ "github.com/hemilabs/heminetwork/service/deucalion"

After being imported, the application may be run with the PROMETHEUS_ADDRESS environment variable set to an address to start the Prometheus metrics server:

PROMETHEUS_ADDRESS=localhost:2112 myapp

The deucalion package may also be used to create a Prometheus metrics server with custom collectors:

d, _ := deucalion.New(&deucalion.Config{
    ListenAddress: PrometheusListenAddress,
})

_ = d.Run(ctx, []prometheus.Collector{})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntToFloat added in v0.9.0

func IntToFloat(x int) float64

func Uint64ToFloat added in v0.9.0

func Uint64ToFloat(x uint64) float64

Types

type Config

type Config struct {
	ListenAddress string
	// contains filtered or unexported fields
}

func NewDefaultConfig

func NewDefaultConfig() *Config

type Deucalion

type Deucalion struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *Config) (*Deucalion, error)

func (*Deucalion) Run

func (d *Deucalion) Run(ctx context.Context, cs []prometheus.Collector) error

func (*Deucalion) Running added in v0.9.0

func (d *Deucalion) Running() bool

Jump to

Keyboard shortcuts

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