LoginSignup
2
0

More than 5 years have passed since last update.

PrometheusのMetrics名は命名規則に準拠しないとエラーで読み取ってくれない

Posted at

概要

  • PrometheusのMetrics名にはルールがある
  • 守っていないとエラーで読み取ってくれない

経緯

  1. fluent-plugin-prometheusを使用する
  2. メトリックス名を「2xx_count」にする
  3. エラーで読み取ってもらえない

次のようなfluentd.configを定義(抜粋)した。

<filter status.*.*.*>↲
  @type prometheus↲
  <labels>↲
    tag ${tag}↲
  </labels>↲
  <metric>↲
    name 2xx_counter↲
    desc 2xx counts↲
    type counter↲
    key 2xx_count↲
  </metric>↲
</filter>

Fluentdを起動すると次のようなエラーが出て読み取ってもらえない。

text format parsing error in line 1: invalid metric name in comment

これは、PrometheusのMetrics名のルールに従っていないから。
name 2xx_counter↲ここをhttp_response_code_2xx_countに変更したら、正常に動作した。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0