Skip to content

Commit

Permalink
Aerospike Prometheus Exporter v1.5.0 Release (#48)
Browse files Browse the repository at this point in the history
- [TOOLS-1946] - Add support for per-job scan and query statistics
- [TOOLS-1947] - Add support for secondary index statistics
  • Loading branch information
spkesan authored Feb 28, 2022
1 parent bf6af43 commit 49f4108
Show file tree
Hide file tree
Showing 12 changed files with 350 additions and 61 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
This file documents all notable changes to Aerospike Prometheus Exporter


## [v1.5.0](https://github.com/aerospike/aerospike-prometheus-exporter/releases/tag/v1.5.0)

### Features
- [TOOLS-1946] - Add support for per-job scan and query statistics
- [TOOLS-1947] - Add support for secondary index statistics


## [v1.4.1](https://github.com/aerospike/aerospike-prometheus-exporter/releases/tag/v1.4.1)

### Improvements
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM golang:alpine AS builder

ARG VERSION=v1.3.0
ARG VERSION=v1.5.0

ADD . $GOPATH/src/github.com/aerospike/aerospike-prometheus-exporter
WORKDIR $GOPATH/src/github.com/aerospike/aerospike-prometheus-exporter
Expand All @@ -16,8 +16,6 @@ COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN apk add gettext libintl \
&& chmod +x /docker-entrypoint.sh

# you could change the port via env var and then would have to --expose in run.
# That is likely unnecessary though
EXPOSE 9145

ENTRYPOINT [ "/docker-entrypoint.sh" ]
Expand Down
62 changes: 37 additions & 25 deletions ape.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ root_ca = ""
key_file_passphrase = ""

# labels to add to the prometheus metrics for e.g. labels={zone="asia-south1-a", platform="google compute engine"}
labels={}
labels = {}

bind = ":9145"

Expand All @@ -47,12 +47,12 @@ log_level = ""
# 3. Credential via environment variable - "env:<environment-variable-that-contains-credential>"
# 4. Credential via environment variable containing base64 encoded credential - "env-b64:<environment-variable-that-contains-base64-encoded-credential>"
# 5. Credential in base64 encoded form - "b64:<base64-encoded-credential>"
basic_auth_username=""
basic_auth_password=""
basic_auth_username = ""
basic_auth_password = ""

[Aerospike]
db_host="localhost"
db_port=3000
db_host = "localhost"
db_port = 3000

# TLS certificates.
# Supports below formats,
Expand All @@ -62,24 +62,24 @@ db_port=3000
# Applicable to 'root_ca', 'cert_file' and 'key_file' configurations.

# root certificate file
root_ca=""
root_ca = ""

# certificate file
cert_file=""
cert_file = ""

# key file
key_file=""
key_file = ""

# Passphrase for encrypted key_file. Supports below formats,
# 1. Passphrase directly - "<passphrase>"
# 2. Passphrase via file - "file:<file-that-contains-passphrase>"
# 3. Passphrase via environment variable - "env:<environment-variable-that-holds-passphrase>"
# 4. Passphrase via environment variable containing base64 encoded passphrase - "env-b64:<environment-variable-that-contains-base64-encoded-passphrase>"
# 5. Passphrase in base64 encoded form - "b64:<base64-encoded-passphrase>"
key_file_passphrase=""
key_file_passphrase = ""

# node TLS name for authentication
node_tls_name=""
node_tls_name = ""

# Aerospike cluster security credentials.
# Supports below formats,
Expand All @@ -91,54 +91,66 @@ node_tls_name=""
# Applicable to 'user' and 'password' configurations.

# database user
user=""
user = ""

# database password
password=""
password = ""

# authentication mode: internal (for server), external (LDAP, etc.)
auth_mode=""
auth_mode = ""

# timeout for sending commands to the server node in seconds
timeout=5
timeout = 5

# Number of histogram buckets to export for latency metrics. Bucket thresholds range from 2^0 to 2^16 (17 buckets).
# e.g. latency_buckets_count=5 will export first five buckets i.e. <=1ms, <=2ms, <=4ms, <=8ms and <=16ms.
# Default: 0 (export all threshold buckets).
latency_buckets_count=0
latency_buckets_count = 0

# Metrics Allowlist - If specified, only these metrics will be scraped. An empty list will exclude all metrics.
# Commenting out the below allowlist configs will disable metrics filtering (i.e. all metrics will be scraped).

# Namespace metrics allowlist
# namespace_metrics_allowlist=[]
# namespace_metrics_allowlist = []

# Set metrics allowlist
# set_metrics_allowlist=[]
# set_metrics_allowlist = []

# Node metrics allowlist
# node_metrics_allowlist=[]
# node_metrics_allowlist = []

# XDR metrics allowlist (only for Aerospike versions 5.0 and above)
# xdr_metrics_allowlist=[]
# xdr_metrics_allowlist = []

# Job (scans/queries) metrics allowlist
# job_metrics_allowlist = []

# Secondary index metrics allowlist
# sindex_metrics_allowlist = []

# Metrics Blocklist - If specified, these metrics will be NOT be scraped.

# Namespace metrics blocklist
# namespace_metrics_blocklist=[]
# namespace_metrics_blocklist = []

# Set metrics blocklist
# set_metrics_blocklist=[]
# set_metrics_blocklist = []

# Node metrics blocklist
# node_metrics_blocklist=[]
# node_metrics_blocklist = []

# XDR metrics blocklist (only for Aerospike versions 5.0 and above)
# xdr_metrics_blocklist=[]
# xdr_metrics_blocklist = []

# Job (scans/queries) metrics blocklist
# job_metrics_blocklist = []

# Secondary index metrics blocklist
# sindex_metrics_blocklist = []

# Users Statistics (user statistics are available in Aerospike 5.6+)
# Users Allowlist and Blocklist to control for which users their statistics should be collected.
# Note globbing patterns are not supported for this configuration.

# user_metrics_users_allowlist=[]
# user_metrics_users_blocklist=[]
# user_metrics_users_allowlist = []
# user_metrics_users_blocklist = []
62 changes: 37 additions & 25 deletions ape.toml.template
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ log_level = "${AGENT_LOG_LEVEL}"
# 3. Credential via environment variable - "env:<environment-variable-that-contains-credential>"
# 4. Credential via environment variable containing base64 encoded credential - "env-b64:<environment-variable-that-contains-base64-encoded-credential>"
# 5. Credential in base64 encoded form - "b64:<base64-encoded-credential>"
basic_auth_username="${BASIC_AUTH_USERNAME}"
basic_auth_password="${BASIC_AUTH_PASSWORD}"
basic_auth_username = "${BASIC_AUTH_USERNAME}"
basic_auth_password = "${BASIC_AUTH_PASSWORD}"

[Aerospike]
db_host="${AS_HOST}"
db_port=${AS_PORT}
db_host = "${AS_HOST}"
db_port = ${AS_PORT}

# TLS certificates.
# Supports below formats,
Expand All @@ -62,24 +62,24 @@ db_port=${AS_PORT}
# Applicable to 'root_ca', 'cert_file' and 'key_file' configurations.

# root certificate file
root_ca="${AS_ROOT_CA}"
root_ca = "${AS_ROOT_CA}"

# certificate file
cert_file="${AS_CERT_FILE}"
cert_file = "${AS_CERT_FILE}"

# key file
key_file="${AS_KEY_FILE}"
key_file = "${AS_KEY_FILE}"

# Passphrase for encrypted key_file. Supports below formats,
# 1. Passphrase directly - "<passphrase>"
# 2. Passphrase via file - "file:<file-that-contains-passphrase>"
# 3. Passphrase via environment variable - "env:<environment-variable-that-holds-passphrase>"
# 4. Passphrase via environment variable containing base64 encoded passphrase - "env-b64:<environment-variable-that-contains-base64-encoded-passphrase>"
# 5. Passphrase in base64 encoded form - "b64:<base64-encoded-passphrase>"
key_file_passphrase="${AS_KEY_FILE_PASSPHRASE}"
key_file_passphrase = "${AS_KEY_FILE_PASSPHRASE}"

# node TLS name for authentication
node_tls_name="${AS_NODE_TLS_NAME}"
node_tls_name = "${AS_NODE_TLS_NAME}"

# Aerospike cluster security credentials.
# Supports below formats,
Expand All @@ -91,54 +91,66 @@ node_tls_name="${AS_NODE_TLS_NAME}"
# Applicable to 'user' and 'password' configurations.

# database user
user="${AS_AUTH_USER}"
user = "${AS_AUTH_USER}"

# database password
password="${AS_AUTH_PASSWORD}"
password = "${AS_AUTH_PASSWORD}"

# authentication mode: internal (for server), external (LDAP, etc.)
auth_mode="${AS_AUTH_MODE}"
auth_mode = "${AS_AUTH_MODE}"

# timeout for sending commands to the server node in seconds
timeout=${TICKER_TIMEOUT}
timeout = ${TICKER_TIMEOUT}

# Number of histogram buckets to export for latency metrics. Bucket thresholds range from 2^0 to 2^16 (17 buckets).
# e.g. latency_buckets_count=5 will export first five buckets i.e. <=1ms, <=2ms, <=4ms, <=8ms and <=16ms.
# e.g. latency_buckets_count = 5 will export first five buckets i.e. <=1ms, <=2ms, <=4ms, <=8ms and <=16ms.
# Default: 0 (export all threshold buckets).
latency_buckets_count=${LATENCY_BUCKETS_COUNT}
latency_buckets_count = ${LATENCY_BUCKETS_COUNT}

# Metrics Allowlist - If specified, only these metrics will be scraped. An empty list will exclude all metrics.
# Commenting out the below allowlist configs will disable metrics filtering (i.e. all metrics will be scraped).

# Namespace metrics allowlist
# namespace_metrics_allowlist=[${NAMESPACE_METRICS_ALLOWLIST}]
# namespace_metrics_allowlist = [${NAMESPACE_METRICS_ALLOWLIST}]

# Set metrics allowlist
# set_metrics_allowlist=[${SET_METRICS_ALLOWLIST}]
# set_metrics_allowlist = [${SET_METRICS_ALLOWLIST}]

# Node metrics allowlist
# node_metrics_allowlist=[${NODE_METRICS_ALLOWLIST}]
# node_metrics_allowlist = [${NODE_METRICS_ALLOWLIST}]

# XDR metrics allowlist (only for Aerospike versions 5.0 and above)
# xdr_metrics_allowlist=[${XDR_METRICS_ALLOWLIST}]
# xdr_metrics_allowlist = [${XDR_METRICS_ALLOWLIST}]

# Job (scans/queries) metrics allowlist
# job_metrics_allowlist = [${JOB_METRICS_ALLOWLIST}]

# Secondary index metrics allowlist
# sindex_metrics_allowlist = [${SINDEX_METRICS_ALLOWLIST}]

# Metrics Blocklist - If specified, these metrics will be NOT be scraped.

# Namespace metrics blocklist
# namespace_metrics_blocklist=[${NAMESPACE_METRICS_BLOCKLIST}]
# namespace_metrics_blocklist = [${NAMESPACE_METRICS_BLOCKLIST}]

# Set metrics blocklist
# set_metrics_blocklist=[${SET_METRICS_BLOCKLIST}]
# set_metrics_blocklist = [${SET_METRICS_BLOCKLIST}]

# Node metrics blocklist
# node_metrics_blocklist=[${NODE_METRICS_BLOCKLIST}]
# node_metrics_blocklist = [${NODE_METRICS_BLOCKLIST}]

# XDR metrics blocklist (only for Aerospike versions 5.0 and above)
# xdr_metrics_blocklist=[${XDR_METRICS_BLOCKLIST}]
# xdr_metrics_blocklist = [${XDR_METRICS_BLOCKLIST}]

# Job (scans/queries) metrics blocklist
# job_metrics_blocklist = [${JOB_METRICS_BLOCKLIST}]

# Secondary index metrics blocklist
# sindex_metrics_blocklist = [${SINDEX_METRICS_BLOCKLIST}]

# Users Statistics (user statistics are available in Aerospike 5.6+)
# Users Allowlist and Blocklist to control for which users their statistics should be collected.
# Note globbing patterns are not supported for this configuration.

# user_metrics_users_allowlist=[${USER_METRICS_USERS_ALLOWLIST}]
# user_metrics_users_blocklist=[${USER_METRICS_USERS_BLOCKLIST}]
# user_metrics_users_allowlist = [${USER_METRICS_USERS_ALLOWLIST}]
# user_metrics_users_blocklist = [${USER_METRICS_USERS_BLOCKLIST}]
22 changes: 22 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ type Config struct {

LatencyBucketsCount uint8 `toml:"latency_buckets_count"`

JobMetricsAllowlist []string `toml:"job_metrics_allowlist"`
JobMetricsBlocklist []string `toml:"job_metrics_blocklist"`

JobMetricsAllowlistEnabled bool
JobMetricsBlocklistEnabled bool

// knob to disable job metrics collection (for internal use only, will be deprecated)
DisableJobMetrics bool `toml:"disable_job_metrics"`

SindexMetricsAllowlist []string `toml:"sindex_metrics_allowlist"`
SindexMetricsBlocklist []string `toml:"sindex_metrics_blocklist"`

SindexMetricsAllowlistEnabled bool
SindexMetricsBlocklistEnabled bool

// knob to disable sindex metrics collection (for internal use only, will be deprecated)
DisableSindexMetrics bool `toml:"disable_sindex_metrics"`

UserMetricsUsersAllowlist []string `toml:"user_metrics_users_allowlist"`
UserMetricsUsersBlocklist []string `toml:"user_metrics_users_blocklist"`

Expand Down Expand Up @@ -182,6 +200,10 @@ func initAllowlistAndBlocklistConfigs(config *Config, md toml.MetaData) {
config.Aerospike.XdrMetricsAllowlistEnabled = md.IsDefined("Aerospike", "xdr_metrics_allowlist")
config.Aerospike.UserMetricsUsersAllowlistEnabled = md.IsDefined("Aerospike", "user_metrics_users_allowlist")
config.Aerospike.UserMetricsUsersBlocklistEnabled = md.IsDefined("Aerospike", "user_metrics_users_blocklist")
config.Aerospike.JobMetricsAllowlistEnabled = md.IsDefined("Aerospike", "job_metrics_allowlist")
config.Aerospike.JobMetricsBlocklistEnabled = md.IsDefined("Aerospike", "job_metrics_blocklist")
config.Aerospike.SindexMetricsAllowlistEnabled = md.IsDefined("Aerospike", "sindex_metrics_allowlist")
config.Aerospike.SindexMetricsBlocklistEnabled = md.IsDefined("Aerospike", "sindex_metrics_blocklist")

// Initialize BlocklistEnabled config
config.Aerospike.NamespaceMetricsBlocklistEnabled = md.IsDefined("Aerospike", "namespace_metrics_blocklist")
Expand Down
4 changes: 4 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export NODE_METRICS_BLOCKLIST=${NODE_METRICS_BLOCKLIST:-""}
export XDR_METRICS_BLOCKLIST=${XDR_METRICS_BLOCKLIST:-""}
export USER_METRICS_USERS_ALLOWLIST=${USER_METRICS_USERS_ALLOWLIST:-""}
export USER_METRICS_USERS_BLOCKLIST=${USER_METRICS_USERS_BLOCKLIST:-""}
export JOB_METRICS_ALLOWLIST=${JOB_METRICS_ALLOWLIST:-""}
export JOB_METRICS_BLOCKLIST=${JOB_METRICS_BLOCKLIST:-""}
export SINDEX_METRICS_ALLOWLIST=${SINDEX_METRICS_ALLOWLIST:-""}
export SINDEX_METRICS_BLOCKLIST=${SINDEX_METRICS_BLOCKLIST:-""}

if [ -f /etc/aerospike-prometheus-exporter/ape.toml.template ]; then
envsubst < /etc/aerospike-prometheus-exporter/ape.toml.template > /etc/aerospike-prometheus-exporter/ape.toml
Expand Down
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ module github.com/aerospike/aerospike-prometheus-exporter
go 1.16

require (
github.com/BurntSushi/toml v0.4.1
github.com/aerospike/aerospike-client-go/v5 v5.4.0
github.com/BurntSushi/toml v1.0.0
github.com/aerospike/aerospike-client-go/v5 v5.7.0
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/gobwas/glob v0.2.3
github.com/hashicorp/go-version v1.3.0
github.com/hashicorp/go-version v1.4.0
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/common v0.30.0 // indirect
github.com/prometheus/client_golang v1.12.1
github.com/prometheus/procfs v0.7.3 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect
golang.org/x/sys v0.0.0-20210903071746-97244b99971b // indirect
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect
google.golang.org/protobuf v1.27.1 // indirect
)
Loading

0 comments on commit 49f4108

Please sign in to comment.