The information contained in this article has been verified as up-to-date on the date of the original publication of the article. HashiCorp endeavors to keep this information up-to-date and correct, but it makes no representations or warranties of any kind, express or implied, about the ongoing completeness, accuracy, reliability, or suitability of the information provided.
All information contained in this article is for general information purposes only. Any reliance you place on such information as it applies to your use of your HashiCorp product is therefore strictly at your own risk.
Introduction
Consul on Kubernetes and Dynatrace StatsD are supported only for ActiveGate remote monitoring. This article will guide you through configuring this recommended StatsD ingestion method.
DynatraceStatsD
StatsD: Industry standard communication protocol for communicating arbitrary statistics and other metrics in a vendor-agnostic fashion. StatsD operates using the UDP protocol.
Important Note: At the time of writing this article, Dynatrace only supports StatsD metrics ingestion from a Virtual Machine. Deployments of OneAgent using Dynatrace's Kubernetes Operator aren't fully supported. It's recommended to monitor Kubernetes application StatsD metrics via the Remote StatsD monitoring method via ActiveGate. |
Dynatrace offers several ingestion methods of capturing application service-level metrics for Consul and Consul's Service Mesh components on Kubernetes. At the time of writing this article Dynatrace could provide a means of observing Consul metrics via:
Prerequisites
- External Host Deployed to routable location from Kubernetes cluster.
- Environment ActiveGate installed on host.
-
Environment ActiveGate StatsD Extension enabled and listening on UDP port
18126
Procedure
Networking Requirements
Default DynatraceStatsD UDP Port Setting: 18126
Note: DynatraceStatsD UDP Port setting can be altered by editing the extensions configuration file located at #STATSD configuration |
Egress Firewall Allowlist (Kube Cluster to ActiveGate Host):
- Port
18126/udp
- External VM Host running ActiveGate (General L4 Connectivity).
Consul Metrics StatsD Configuration
In order for Consul to start sending metrics to DynatraceStatsD via the ActiveGate host, you must properly configure the Consul Server Agent telemetry settings to set the desired StatsD metrics sync host.
Consul Helm Overrides (Server Telemetry)
Update your Consul Helm Chart overrides to point Consul to the external Dynatrace ActiveGate previously deployed. The example below assumes the ActiveGate hostname ip-10-0-39-200.us-east-2.compute.internal
and StatsD UDP Port 18126
.
server:
enabled: true
replicas: 3
extraConfig: |
{
"telemetry": {
"statsd_address": "ip-10-0-39-200.us-east-2.compute.internal:18126"
}
}
Consul Helm Overrides (Metrics Enablement)
Additionally, in order for Consul to know to emit metrics data to Dynatrace metrics must enabled for the Consul Server agent. Update the Consul Helm Chart with the following entries.
global:
metrics:
enabled: true
enableAgentMetrics: true
disableAgentHostName: true
enableHostMetrics: true
Overrides:
-
global.metrics.enabled
andglobal.metrics.enableAgentMetrics
: Configures server agent's telemetry.prometheus_retention_time to 1m to enable exposing Consul specific metrics for collection and submission. -
global.metrics.disableAgentHostName
: Configures Consul to disable sending StatsD hostname prefixes as Dynatrace detects this by default. -
global.metrics.enableHostMetrics
: Configures Kubernetes node related metrics as captured by Consul (i.e. CPU, memory, and disk data)
After updating Consul's Helm Chart overrides, run helm upgrade to apply the changes:
# Example Helm Upgrade Command
$ helm upgrade consul hashicorp/consul --namespace consul --values values.yaml
Dynatrace Consul StatsD Verification
You can verify Dynatrace is receiving StatsD metrics data from Consul by navigating to the Metrics App within your environment's Dynatrace portal and search for consul
.