# class Prometheus::Sample

- Prometheus::Sample
- Reference
- Object

##
Overview

Represents a single sample value at a point in time.

A Sample combines:

- A metric name
- A set of labels
- A numeric value
- An optional timestamp

Samples are used to represent the actual data points collected by metrics. The Sample format follows the Prometheus exposition format:

    metric_name{label="value"} 42
    # Or with timestamp:
    metric_name{label="value"} 42 1234567890

##
Defined in:

types.cr

##
Constructors

- .new(name : String, labels : LabelSet, value : Float64, timestamp : Int64 | Nil = nil)

##
Instance Method Summary

- #labels : LabelSet
- #name : String
- #timestamp : Int64 | Nil
- #to_s(io : IO)

  Appends a short String representation of this object which includes its class name and its object address.

- #value : Float64

##
Constructor Detail

def self.new(name : String, labels : LabelSet, value : Float64, timestamp : Int64 | Nil = nil) #

##
Instance Method Detail

def labels : LabelSet #
def name : String #
def timestamp : Int64 | Nil #
def to_s(io : IO) #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

    class Person
      def initialize(@name : String, @age : Int32)
      end
    end

    Person.new("John", 32).to_s # => #<Person:0x10a199f20>

def value : Float64 #