Prometheus
Prometheus Filter
Overview
Prometheus Filter Plugin to count Incoming Records
Configuration
PrometheusConfig
labels (Label, optional)
metrics ([]MetricSection, optional)
Metrics Section
buckets (string, optional)
Buckets of record for instrumentation
desc (string, required)
Description of metric
key (string, optional)
Key name of record for instrumentation.
labels (Label, optional)
Additional labels for this metric
name (string, required)
Metrics name
type (string, required)
Metrics type counter, gauge, summary, histogram
Example Prometheus
filter configurations
apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:
name: demo-flow
spec:
filters:
- tag_normaliser: {}
- parser:
remove_key_name_field: true
reserve_data: true
parse:
type: nginx
- prometheus:
metrics:
- name: total_counter
desc: The total number of foo in message.
type: counter
labels:
foo: bar
labels:
host: ${hostname}
tag: ${tag}
namespace: $.kubernetes.namespace
selectors: {}
localOutputRefs:
- demo-output
Fluentd config result:
<filter **>
@type prometheus
@id logging-demo-flow_2_prometheus
<metric>
desc The total number of foo in message.
name total_counter
type counter
<labels>
foo bar
</labels>
</metric>
<labels>
host ${hostname}
namespace $.kubernetes.namespace
tag ${tag}
</labels>
</filter>
Last modified June 3, 2024: [4.6] Blog link fix (cc4602a)