View Source TelemetryMetricsSplunk.Hec.Api (TelemetryMetricsSplunk v0.0.4-alpha)

Sends metrics to the Splunk HTTP Event Collector (HEC).

alias TelemetryMetricsSplunk.Hec.Api

measurements = %{
  "vm.memory.total.summary" => 500
}

options = [
  finch: MyFinch,
  token: "00000000-0000-0000-0000-000000000000",
  url: "https://example.splunkcloud.com:8088/services/collector"
]

metadata = %{
  "server" => "alpha"
}

Api.send(measurements, options, metadata)

NOTE Metadata is optional and gets sent as dimensions.

Summary

Functions

Sends metrics to the Splunk HTTP Event Collector (HEC).

Types

@type options() :: [
  finch: Finch.name() | nil,
  token: String.t() | nil,
  url: String.t() | nil
]

Functions

Link to this function

send(measurements, options, metadata \\ %{})

View Source
@spec send(measurements :: map(), options :: options(), metadata :: map()) :: :ok

Sends metrics to the Splunk HTTP Event Collector (HEC).

If finch, token, or url are nil, the function will log the info and not send the metrics.