TelemetryMetricsZabbix v0.1.1 TelemetryMetricsZabbix View Source

Provides a Zabbix format reporter and server for Telemetry.Metrics definitions.

Installation

The package can be installed by adding telemetry_metrics_zabbix to your list of dependencies in mix.exs:

def deps do
  [
    {:telemetry_metrics_zabbix, "~> 0.1"}
  ]
end

Configuration

Add approperiate config section to your config.exs

config :telemetry_metrics_zabbix, :config,
  host: "zabbix.trapper.host",
  port: 10051,
  hostname: "monitored.host",
  batch_window_size: 1000,
  timestamping: true

Usage

Add TelemetryMetricsZabbix to your application supervision tree and pass metrics as a param.

Example

metrics = [
  Telemetry.Metrics.sum("http.request.latency", tags: [:host])
]

children = [
  {TelemetryMetricsZabbix, metrics: metrics}
]
opts = [strategy: :one_for_one, name: MyApp]
Supervisor.start_link(children, opts)

Currently supported metrics

Measuremet to zabbix value conversion

Measurements are aggregated by event name, measurement and tag values. All those parts are included as Zabbix Sender Protocol key

Example

with metric

Telemetry.Metrics.sum("http.request.latency", tags: [:host])

and event

:telemetry.execute([:http, :request], %{latency: 200}, %{host: "localhost"})

Zabbix key will be http.request.latency.localhost

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Link to this section Types

Link to this type

t()

View Source
t() :: %TelemetryMetricsZabbix{
  batch_timeout: reference(),
  batch_window_size: Integer.t(),
  data: %{},
  host: String.t(),
  hostname: String.t(),
  metrics: [any()],
  port: Integer.t(),
  timestamping: boolean()
}

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.