Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/core/last_value.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ defmodule TelemetryMetricsPrometheus.Core.LastValue do

def register(metric, table_id, owner) do
handler_id = EventHandler.handler_id(metric.name, owner)
type = Keyword.get(metric.reporter_options, :prometheus_type, default_prometheus_type())

with :ok <-
:telemetry.attach(
Expand All @@ -34,7 +35,7 @@ defmodule TelemetryMetricsPrometheus.Core.LastValue do
table: table_id,
tags: metric.tags,
tag_values_fun: metric.tag_values,
type: :gauge
type: type
}
) do
{:ok, handler_id}
Expand Down Expand Up @@ -66,4 +67,7 @@ defmodule TelemetryMetricsPrometheus.Core.LastValue do
error -> EventHandler.handle_event_error(error, config)
end
end

@spec default_prometheus_type() :: :gauge
def default_prometheus_type(), do: :gauge
end