Package

io.chrisdavenport

epimetheus

Permalink

package epimetheus

Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. epimetheus
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class Collector extends AnyRef

    Permalink

    A Collector Represents a Metric or Group of Metrics that can be registered with a CollectorRegistry.

    A Collector Represents a Metric or Group of Metrics that can be registered with a CollectorRegistry.

    This is generally used for wrapping and bringing in Collectors as defined for Java Components

  2. final class CollectorRegistry[F[_]] extends AnyRef

    Permalink

    A CollectorRegistry is a registry of Collectors.

    A CollectorRegistry is a registry of Collectors.

    It represents the concurrently shared state which holds the information of the metrics in question.

    On Creation

    Due to how prometheus scraping occurs, only one CollectorRegistry is generally useful per application. There are generally 2 approaches.

    1. Create your own registry. Register Metrics with it. Expose that. Advantages: Full Control Of the Code 2. Use the global defaultRegistry Advantages: Easier Interop with Java libraries that may not give an option for interaction with arbitrary CollectorRegistries.

  3. sealed abstract class Counter[F[_]] extends AnyRef

    Permalink

    Counter metric, to track counts, running totals, or events.

    Counter metric, to track counts, running totals, or events.

    If your use case can go up or down consider using a Gauge instead. Use the rate() function in Prometheus to calculate the rate of increase of a Counter. By convention, the names of Counters are suffixed by _total.

    An Example Counter without Labels:

    for {
      cr <- CollectorRegistry.build[IO]
      successCounter <- Counter.noLabels(cr, "example_success_total", "Example Counter of Success")
      failureCounter <- Counter.noLabels(Cr, "example_failure_total", "Example Counter of Failure")
      _ <- IO(println("Action Here")).guaranteeCase{
        case ExitCase.Completed => successCounter.inc
        case _ => failureCounter.inc
      }
    } yield ()

    An Example of a Counter with Labels:

    for {
      cr <- CollectorRegistry.build[IO]
      counter <- Counter.labelled(cr, "example_total", "Example Counter", Sized("foo"), {s: String => Sized(s)})
      _ <- counter.label("bar").inc
      _ <- counter.label("baz").inc
    } yield ()
  4. sealed abstract class Gauge[F[_]] extends AnyRef

    Permalink

    Gauge metric, to report instantaneous values.

    Gauge metric, to report instantaneous values.

    Gauges can go both up and down.

    An Example With No Labels:

    for {
      cr <- CollectorRegistry.build
      gauge <- Gauge.noLabels(cr, "gauge_value", "Gauge Help")
      _ <- gauge.inc
      _ <- gauge.dec
    } yield ()

    An Example With Labels:

    for {
      cr <- CollectorRegistry.build
      gauge <- Gauge.labelled(cr, "gauge_value", "Gauge Help", Sized("foo"), {s: String => Sized(s)})
      _ <- gauge.label("bar").inc
      _ <- gauge.label("bar").dec
      _ <- gauge.label("baz").inc
      _ <- gauge.label("baz").dec

    These can be aggregated and processed together much more easily in the Prometheus server than individual metrics for each labelset.

  5. sealed abstract class Histogram[F[_]] extends AnyRef

    Permalink

    Histogram metric, to track distributions of events.

    Histogram metric, to track distributions of events.

    Note: Each bucket is one timeseries. Many buckets and/or many dimensions with labels can produce large amount of time series, that may cause performance problems.

    The default buckets are intended to cover a typical web/rpc request from milliseconds to seconds.

  6. final class Label extends AnyVal

    Permalink
  7. final class Name extends AnyVal

    Permalink
  8. sealed abstract class Summary[F[_]] extends AnyRef

    Permalink

    Summary metric, to track the size of events.

    Summary metric, to track the size of events.

    The quantiles are calculated over a sliding window of time. There are two options to configure this time window:

    maxAgeSeconds: Long - Set the duration of the time window is, i.e. how long observations are kept before they are discarded. Default is 10 minutes.

    ageBuckets: Int - Set the number of buckets used to implement the sliding time window. If your time window is 10 minutes, and you have ageBuckets=5, buckets will be switched every 2 minutes. The value is a trade-off between resources (memory and cpu for maintaining the bucket) and how smooth the time window is moved. Default value is 5.

    See https://prometheus.io/docs/practices/histograms/ for more info on quantiles.

  9. type UnlabelledCounter[F[_], A] = epimetheus.Counter.UnlabelledCounter[F, A]

    Permalink
  10. type UnlabelledGauge[F[_], A] = epimetheus.Gauge.UnlabelledGauge[F, A]

    Permalink
  11. type UnlabelledHistogram[F[_], A] = epimetheus.Histogram.UnlabelledHistogram[F, A]

    Permalink
  12. type UnlabelledSummary[F[_], A] = epimetheus.Summary.UnlabelledSummary[F, A]

    Permalink

Value Members

  1. object Collector

    Permalink
  2. object CollectorRegistry

    Permalink
  3. object Counter

    Permalink

    Counter Constructors, and Unsafe Counter Access

  4. object Gauge

    Permalink

    Gauge Constructors, and Unsafe Gauge Access

  5. object Histogram

    Permalink

    Histogram Constructors, Convenience Methods and Unsafe Histogram Access

    Histogram Constructors, Convenience Methods and Unsafe Histogram Access

    Convenience function exposed here will also be exposed as implicit syntax enhancements on the Histogram

  6. object Label

    Permalink
  7. object Name

    Permalink
  8. object Summary

    Permalink

    Summary Constructors, and Unsafe Summary Access

  9. package implicits

    Permalink
  10. package syntax

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped