Static metrics
Publish statically configured metrics on an interval
status: stable
role: aggregator
role: daemon
role: sidecar
delivery: at-least-once
acknowledgements: no
egress: batch
state: stateless
output: metrics
Publish statically configured metrics on an interval. This can be useful for publishing
heartbeats or sending the value of an environment variable as a metric.
Configuration
Example configurations
{
"sources": {
"my_source_id": {
"type": "static_metrics"
}
}
}
[sources.my_source_id]
type = "static_metrics"
sources:
my_source_id:
type: static_metrics
{
"sources": {
"my_source_id": {
"type": "static_metrics",
"interval_secs": 1,
"metrics": {
"kind": "absolute",
"name": null,
"value": null
},
"namespace": "static"
}
}
}
[sources.my_source_id]
type = "static_metrics"
interval_secs = 1
namespace = "static"
[sources.my_source_id.metrics]
kind = "absolute"
sources:
my_source_id:
type: static_metrics
interval_secs: 1
metrics:
kind: absolute
name: null
value: null
namespace: static
namespace
optional string literalOverrides the default namespace for the metrics emitted by the source.
default:
static
Outputs
<component_id>
Default output stream of the component. Use this component’s ID as an input to downstream transforms and sinks.
Output Data
Metrics
counter
counterA single value that can be incremented or reset to a zero value but not decremented.
*
optional
Any tags present on the metric.
distribution
distributionA distribution represents a distribution of
sampled values. It is used with services
that support global histograms and summaries.
*
optional
Any tags present on the metric.
Telemetry
Metrics
linkcomponent_discarded_events_total
counterThe number of events dropped by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
intentional
True if the events were discarded intentionally, like a
filter
transform, or false if due to an error.pid
optional
The process ID of the Vector instance.
component_errors_total
counterThe total number of errors encountered by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
error_type
The type of the error
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
stage
The stage within the component at which the error occurred.
component_received_bytes_total
counterThe number of raw bytes accepted by this component from source origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_received_event_bytes_total
counterThe number of event bytes accepted by this component either from
tagged origins like file and uri, or cumulatively from other origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_received_events_count
histogramA histogram of the number of events passed in each internal batch in Vector’s internal topology.
Note that this is separate than sink-level batching. It is mostly useful for low level debugging performance issues in Vector due to small internal batches.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_received_events_total
counterThe number of events accepted by this component either from tagged
origins like file and uri, or cumulatively from other origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_sent_event_bytes_total
counterThe total number of event bytes emitted by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
output
optional
The specific output of the component.
pid
optional
The process ID of the Vector instance.
component_sent_events_total
counterThe total number of events emitted by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
output
optional
The specific output of the component.
pid
optional
The process ID of the Vector instance.
source_lag_time_seconds
histogramThe difference between the timestamp recorded in each event and the time when it was ingested, expressed as fractional seconds.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
Examples
Emit a heartbeat
Given this event...
sources:
my_source_id:
type: static_metrics
metrics:
- name: heartbeat
kind: absolute
value:
gauge: 1
tags:
env: ${ENV}
[sources.my_source_id]
type = "static_metrics"
[[sources.my_source_id.metrics]]
name = "heartbeat"
kind = "absolute"
[sources.my_source_id.metrics.value]
gauge = 1
[sources.my_source_id.metrics.tags]
env = "${ENV}"
{
"sources": {
"my_source_id": {
"type": "static_metrics",
"metrics": [
{
"name": "heartbeat",
"kind": "absolute",
"value": {
"gauge": 1
},
"tags": {
"env": "${ENV}"
}
}
]
}
}
}
{
"gauge": {
"value": 1
},
"kind": "absolute",
"name": "heartbeat",
"namespace": "static",
"tags": {
"env": "${ENV}"
},
"timestamp": "2024-09-10T19:04:58Z"
}