Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/send-data/alloy/reference/components/prometheus/prometheus.exporter.memcached.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/send-data/alloy/reference/components/prometheus/prometheus.exporter.memcached/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
prometheus.exporter.memcached
The prometheus.exporter.memcached component embeds the memcached_exporter for collecting metrics from a Memcached server.
Usage
prometheus.exporter.memcached "<LABEL>" {
}Arguments
You can use the following arguments with prometheus.exporter.memcached:
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
address | string | The Memcached server address. | "localhost:11211" | no |
timeout | duration | The timeout for connecting to the Memcached server. | "1s" | no |
Blocks
You can use the following block with prometheus.exporter.memcached:
No valid configuration blocks found.
tls_config
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
ca_pem | string | CA PEM-encoded text to validate the server with. | no | |
ca_file | string | CA certificate to validate the server with. | no | |
cert_pem | string | Certificate PEM-encoded text for client authentication. | no | |
cert_file | string | Certificate file for client authentication. | no | |
insecure_skip_verify | bool | Disables validation of the server certificate. | no | |
key_file | string | Key file for client authentication. | no | |
key_pem | secret | Key PEM-encoded text for client authentication. | no | |
min_version | string | Minimum acceptable TLS version. | no | |
server_name | string | ServerName extension to indicate the name of the server. | no |
The following pairs of arguments are mutually exclusive and can’t both be set simultaneously:
ca_pemandca_filecert_pemandcert_filekey_pemandkey_file
When configuring client authentication, both the client certificate (using cert_pem or cert_file) and the client key (using key_pem or key_file) must be provided.
When min_version isn’t provided, the minimum acceptable TLS version is inherited from Go’s default minimum version, TLS 1.2.
If min_version is provided, it must be set to one of the following strings:
"TLS10"(TLS 1.0)"TLS11"(TLS 1.1)"TLS12"(TLS 1.2)"TLS13"(TLS 1.3)
Caution
If you set
insecure_skip_verifytotrue, you disable verification of the server’s certificate chain and hostname. Alloy accepts any certificate the server presents, including expired, self-signed, or invalid certificates.You can use
insecure_skip_verifyfor local development, self-signed certificates, or endpoints that use a private CA outside the system trust store. If the hostname doesn’t match the certificate, setserver_nameinstead ofinsecure_skip_verify. In production, useca_fileorca_pemto trust a private CA instead ofinsecure_skip_verify.Set
insecure_skip_verifytotrueonly in isolated development or testing environments where you don’t transmit sensitive data. Remove the setting before you deploy to production.
Exported fields
The following fields are exported and can be referenced by other components.
| Name | Type | Description |
|---|---|---|
targets | list(map(string)) | The targets that can be used to collect exporter metrics. |
For example, the targets can either be passed to a discovery.relabel component to rewrite the targets’ label sets or to a prometheus.scrape component that collects the exposed metrics.
The exported targets use the configured in-memory traffic address specified by the run command.
Component health
prometheus.exporter.memcached is only reported as unhealthy if given an invalid configuration.
In those cases, exported fields retain their last healthy values.
Debug information
prometheus.exporter.memcached doesn’t expose any component-specific debug information.
Debug metrics
prometheus.exporter.memcached doesn’t expose any component-specific debug metrics.
Example
The following example uses a prometheus.exporter.memcached component to collect metrics from a Memcached server running locally, and scrapes the metrics using a prometheus.scrape component:
prometheus.exporter.memcached "example" {
address = "localhost:13321"
timeout = "5s"
}
prometheus.scrape "example" {
targets = prometheus.exporter.memcached.example.targets
forward_to = [prometheus.remote_write.demo.receiver]
}
prometheus.remote_write "demo" {
endpoint {
url = "<PROMETHEUS_REMOTE_WRITE_URL>"
basic_auth {
username = "<USERNAME>"
password = "<PASSWORD>"
}
}
}Replace the following:
<PROMETHEUS_REMOTE_WRITE_URL>: The URL of the Prometheusremote_writecompatible server to send metrics to.<USERNAME>: The username to use for authentication to theremote_writeAPI.<PASSWORD>: The password to use for authentication to theremote_writeAPI.
Compatible components
prometheus.exporter.memcached has exports that can be consumed by the following components:
- Components that consume Targets
Note
Connecting some components may not be sensible or components may require further configuration to make the connection work correctly. Refer to the linked documentation for more details.
Was this page helpful?
Related resources from Grafana Labs


