【问题标题】:Gatling not sending metrics to InfluxDB using graphite protocolGatling 不使用石墨协议向 InfluxDB 发送指标
【发布时间】:2022-01-07 14:14:39
【问题描述】:

我按照 BlazeMeter 文章使用 Grafana 和 InfluxDB 监控 Gatling 测试,但没有数据发送到 InfluxDB,也没有任何名为“gatlingdb”的数据库。 InfluxDB 启动并监听端口:2003。这是来自 InfluxDB 的日志:

2022-01-07T13:57:53.019217Z info    Starting graphite service   {"log_id": "0YuD8znW000", "service": "graphite", "addr": ":2003", "batch_size": 5000, "batch_timeout": "1s"}

我将 gatling.conf 字段设置为:

data {
    writers = [console,file,graphite]      # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite)
    console {
      light = false                # When set to true, displays a light version without detailed request stats
      writePeriod = 5              # Write interval, in seconds
    }
    file {
      bufferSize = 8192            # FileDataWriter's internal data buffer size, in bytes
    }
    leak {
      noActivityTimeout = 30  # Period, in seconds, for which Gatling may have no activity before considering a leak may be happening
    }
    graphite {
      light = false              # only send the all* stats
      host = "localhost"         # The host where the Carbon server is located
      port = 2003                # The port to which the Carbon server listens to (2003 is default for plaintext, 2004 is default for pickle)
      protocol = "tcp"           # The protocol used to send data to Carbon (currently supported : "tcp", "udp")
      rootPathPrefix = "gatling" # The common prefix of all metrics sent to Graphite
      bufferSize = 8192          # Internal data buffer size, in bytes
      writePeriod = 1            # Write period, in seconds
    }
并且 influxdb.conf 包含以下参数

[[graphite]]
  # Determines whether the graphite endpoint is enabled.
  enabled = true
  database = "gatlingdb"
  # retention-policy = ""
  bind-address = ":2003"
  protocol = "tcp"
  consistency-level = "one"

  # These next lines control how batching works. You should have this enabled
  # otherwise you could get dropped metrics or poor performance. Batching
  # will buffer points in memory if you have many coming in.

  # Flush if this many points get buffered
   batch-size = 5000

  # number of batches that may be pending in memory
  # batch-pending = 10

  # Flush at least this often even if we haven't hit buffer limit
  # batch-timeout = "1s"

  # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.
  # udp-read-buffer = 0

  ### This string joins multiple matching 'measurement' values providing more control over the final measurement name.
   separator = "."

  ### Default tags that will be added to all metrics.  These can be overridden at the template level
  ### or by tags extracted from metric
  # tags = ["region=us-east", "zone=1c"]

  ### Each template line requires a template pattern.  It can have an optional
  ### filter before the template and separated by spaces.  It can also have optional extra
  ### tags following the template.  Multiple tags should be separated by commas and no spaces
  ### similar to the line protocol format.  There can be only one default template.
  templates = [
       "gatling.*.*.*.count measurement.simulation.request.status.field",
       "gatling.*.*.*.min measurement.simulation.request.status.field",
       "gatling.*.*.*.max measurement.simulation.request.status.field",
      "gatling.*.*.*.percentiles95 measurement.simulation.request.status.field",
      "gatling.*.*.*.percentiles99 measurement.simulation.request.status.field"      
  ]

现在我正在通过 gatling 运行测试,但在成功完成测试后,没有在 influxdb 上创建名为 galingdb 的数据库。

我不确定我还需要添加什么。

【问题讨论】:

    标签: grafana influxdb gatling graphite scala-gatling


    【解决方案1】:

    您需要手动创建数据库:

    > influx
    > CREATE DATABASE gatlingdb
    

    【讨论】:

    • 理想情况下,如果事件会正确到达 influxdb,我不需要显式创建数据库。现在我创建了数据库,但运行完成后仍然显示空白数据库。
    • 唉,但是数据库需要手动创建,或者你可以写一个脚本来创建一次。好的,让我们回到你的问题。您如何运行 Influx?您是否正确地将路径传递给配置(使用石墨等)?
    • 我用命令“/usr/local/opt/influxdb@1/bin/influxd -config /usr/local/etc/influxdb.conf”启动influxdb,用命令“/usr/local”启动influxdb /opt/influxdb@1/bin/influx”。我在 mac 上的 localhost 上运行所有内容。启动后的 influx 也显示“已连接到 localhost:8086 版本 1.8.9”
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多