Skip to content

Synthetic Monitoring With Telegraf

Synthetic monitoring is critical for identifying and resolving production events, as it allows companies to proactively monitor the availability and performance of their applications and websites. By simulating real user interactions with these systems, synthetic monitoring can help identify potential issues before they affect real users.

This guide outlines the steps required to use the Coralogix Telegraf integration to monitor response codes and response times of URLs and ship the metrics to Coralogix.

This solution can be used in conjunction with the Coralogix Synthetic Monitoring Extension, which provides additional dashboards & alerts around the Telegraf data being produced.

This configuration makes use of the Telegraf plugin inputs.http_response. This plugin allows you to provide a list of URLs to Telegraf which will then attempt to connect to each URL and provide the following metrics:

  • http_response_content_length

  • http_response_http_response_code

  • http_response_response_time

  • http_response_result_code

Prerequisites

  1. Sign up for a Coralogix account. Set up your account on the Coralogix domain corresponding to the region within which you would like your data stored.

  2. Install and configure Telegraf.

Configuration

  1. Once you have configured Telegraf, add the following code into your configuration file:
[[inputs.http_response]]
  ## Server address (default http://localhost)
  urls = ["https://coralogix.com"]

  ## Set response_timeout (default 5 seconds)
  # response_timeout = "5s"

  ## Whether to follow redirects from the server (defaults to false)
  follow_redirects = true

You are required to input the following variables:

  • urls (line 3): Change the values within this list to the URLs that you wish to monitor.

  • response_timeout (line 6): If the URLs that are being monitored usually take longer than 5 seconds to respond, we recommend to uncomment this line and increase the timeout value.

  • follow_redirects (line 9): This instructs Telegraf to follow redirects. Setting this to false will disable this feature. Any URL that returns a redirect response code (e.g. 301 or 302) will not appear as ‘Up’.

Further information on the available values within this configuration block can be found here.

  1. Once you have input the variables above, save the file and restart Telegraf. Telegraf will now start testing connectivity to the URLs and shipping the metrics to Coralogix.

  1. When data is flowing into your Coralogix account, you can then install the Coralogix Synthetic Monitoring Extension, which automatically deploys dashboards & alerts to visualize the telemetry coming from your Telegraf synthetic tests.

Support

Need help?

Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.

Feel free to reach out to us via our in-app chat or by sending us an email to [email protected].