首页 > 解决方案 > 在 InfluxDB v2 中接收 Gatling 结果

问题描述

我在 EC2 实例上有一个基本的 Gatling 脚本,我想从中将结果推送到 Influx 数据库实例中。我可以成功运行 Gatling 脚本并且 Influx 也在运行。

我的加特林配置如下:

data {
    writers = [console, 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 = "ec2-35-181-26-79.eu-west-3.compute.amazonaws.com"         # 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
    }

对于 Influx,我使用以下配置设置了 Telegraf

 [[outputs.influxdb_v2]]
  ## The URLs of the InfluxDB cluster nodes.
  ##
  ## Multiple URLs can be specified for a single cluster, only ONE of the
  ## urls will be written to each interval.
  ## urls exp: http://127.0.0.1:8086
  urls = ["http://ec2-35-181-26-79.eu-west-3.compute.amazonaws.com:8086"]

  ## Token for authentication.
  token = "$INFLUX_TOKEN"

  ## Organization is the name of the organization you wish to write to; must exist.
  organization = "Test"

  ## Destination bucket to write into.
  bucket = "Test"

[[inputs.socket_listener]]
  ## URL to listen on
  service_address = "tcp://:2003"

data_format = "graphite"

  ## Content encoding for message payloads, can be set to "gzip" to or
  ## "identity" to apply no encoding.
  # content_encoding = "identity"

  templates = [
    "gatling.*.*.*.* measurement.simulation.request.status.field",
    "gatling.*.users.*.* measurement.simulation.measurement.request.field"
 ]

在 Telegraf(使用此配置)和 Influx 运行的情况下,我看不到任何数据推送到“测试”存储桶中。此外,我没有得到任何可以帮助我调试的错误。

任何帮助将非常感激。谢谢。

标签: amazon-ec2influxdbgatlingtelegrafgraphite-carbon

解决方案


推荐阅读