OpenRouter

This template is designed to collect OpenRouter trace data. It provides a basic span overview with health indicators, durations, statuses, errors.

Available solutions

Zabbix version 8.0
Download

OpenRouter traces by OTLP

Overview

This template is designed to collect OpenRouter trace data. It provides a basic span overview with health indicators, durations, statuses, errors.

Requirements

Zabbix version: 8.0 and higher.

Tested versions

This template has been tested on:

  • OpenRouter

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

  1. Ensure that OpenRouter account is configured to send traces to your OpenTelemetry collector. Each workspace requires separate configuration.
  2. Ensure that the TelemetryProvider parameter is configured in the Zabbix server configuration file.
  3. Apply the template to the host.
  4. Adjust macros if needed.

Note: OpenRouter sends completions traces only.

Macros used

Name Description Default
{$OPENROUTER.FREQUENCY}

The update interval for OpenTelemetry items.

1m
{$OPENROUTER.LOOPBACK}

The loopback for OpenTelemetry items.

10m
{$OPENROUTER.TIMESHIFT}

The TimeShift for OpenTelemetry items.

10s
{$OPENROUTER.SPAN.ERROR.WARN}

Span error rate threshold, in %.

5
{$OPENROUTER.SPAN.HIT_LIMIT.WARN}

Span hit limit stop reason rate threshold, in %.

10
{$OPENROUTER.SPAN.BYOK.WARN}

BYOK spans rate threshold, in %.

25
{$OPENROUTER.SPAN.PERCENTILE.WARN}

80th percentile for duration threshold, in seconds.

10

Items

Name Description Type Key and additional info
Span: Total count

Total number of spans over the last {$OPENROUTER.FREQUENCY}.

Telemetry query openrouter.span.total

Preprocessing

  • Check for not supported value: error matches "^No value$"

    ⛔️Custom on fail: Set value to: {"columns":{"count":0}}

  • JSON Path: $.columns.count

Span: Error count

Number of spans with status code "Error" over the last {$OPENROUTER.FREQUENCY}.

Telemetry query openrouter.span.status.error

Preprocessing

  • Check for not supported value: error matches "^No value$"

    ⛔️Custom on fail: Set value to: {"columns":{"count":0}}

  • JSON Path: $.columns.count

Span: Error rate

Percentage of error spans.

Calculated openrouter.span.error.rate

Preprocessing

  • Check for not supported value: any error

    ⛔️Custom on fail: Discard value

Span: Stop reason [normal] count

Number of spans normally stopped over the last {$OPENROUTER.FREQUENCY}.

Telemetry query openrouter.span.stop.normal

Preprocessing

  • Check for not supported value: error matches "^No value$"

    ⛔️Custom on fail: Set value to: {"columns":{"count":0}}

  • JSON Path: $.columns.count

Span: Stop reason [hit limit] count

Number of spans stopped because of limit hit over the last {$OPENROUTER.FREQUENCY}.

Telemetry query openrouter.span.stop.hit_limit

Preprocessing

  • Check for not supported value: error matches "^No value$"

    ⛔️Custom on fail: Set value to: {"columns":{"count":0}}

  • JSON Path: $.columns.count

Span: Stop reason [error] count

Number of spans stopped because of the error over the last {$OPENROUTER.FREQUENCY}.

Telemetry query openrouter.span.stop.error

Preprocessing

  • Check for not supported value: error matches "^No value$"

    ⛔️Custom on fail: Set value to: {"columns":{"count":0}}

  • JSON Path: $.columns.count

Span: Hit limit rate

Percentage of spans that hit limit.

Calculated openrouter.span.hit_limit.rate

Preprocessing

  • Check for not supported value: any error

    ⛔️Custom on fail: Discard value

Span: BYOK [false] count

Number of spans without your own key over the last {$OPENROUTER.FREQUENCY}.

Telemetry query openrouter.span.byok.false

Preprocessing

  • Check for not supported value: error matches "^No value$"

    ⛔️Custom on fail: Set value to: {"columns":{"count":0}}

  • JSON Path: $.columns.count

Span: BYOK [true] count

Number of spans with your own key over the last {$OPENROUTER.FREQUENCY}.

Telemetry query openrouter.span.byok.true

Preprocessing

  • Check for not supported value: error matches "^No value$"

    ⛔️Custom on fail: Set value to: {"columns":{"count":0}}

  • JSON Path: $.columns.count

Span: BYOK rate

Percentage of BYOK spans.

Calculated openrouter.span.byok.rate

Preprocessing

  • Check for not supported value: any error

    ⛔️Custom on fail: Discard value

Span: Duration, average

Average span duration over the last {$OPENROUTER.FREQUENCY}.

Telemetry query openrouter.span.duration.avg

Preprocessing

  • JSON Path: $.columns.avg

  • Custom multiplier: 1.0E-9

Span: Duration, minimum

Minimum span duration over the last {$OPENROUTER.FREQUENCY}.

Telemetry query openrouter.span.duration.min

Preprocessing

  • JSON Path: $.columns.min

  • Custom multiplier: 1.0E-9

Span: Duration, maximum

Maximum span duration over the last {$OPENROUTER.FREQUENCY}.

Telemetry query openrouter.span.duration.max

Preprocessing

  • JSON Path: $.columns.max

  • Custom multiplier: 1.0E-9

Span: Duration, 80th percentile

80th percentile of span durations over the last {$OPENROUTER.FREQUENCY}.

Telemetry query openrouter.span.duration.percentile

Preprocessing

  • JSON Path: $.columns.percentile

  • Custom multiplier: 1.0E-9

Triggers

Name Description Expression Severity Dependencies and additional info
OpenRouter: High span error rate min(/OpenRouter traces by OTLP/openrouter.span.error.rate,5m)>{$OPENROUTER.SPAN.ERROR.WARN} Warning
OpenRouter: High hit limit stop reason rate min(/OpenRouter traces by OTLP/openrouter.span.hit_limit.rate,5m)>{$OPENROUTER.SPAN.HIT_LIMIT.WARN} Warning
OpenRouter: High BYOK rate min(/OpenRouter traces by OTLP/openrouter.span.byok.rate,5m)>{$OPENROUTER.SPAN.BYOK.WARN} Warning
OpenRouter: High span duration for 80% of spans min(/OpenRouter traces by OTLP/openrouter.span.duration.percentile,5m)>{$OPENROUTER.SPAN.PERCENTILE.WARN} Warning

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide feedback, discuss the template, or ask for help at ZABBIX forums

Articles and documentation

+ Propose new article

Didn't find integration you need?