Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions transform-metrics/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3.8'
services:
vector:
image: timberio/vector:nightly-alpine
volumes:
- ./vector:/etc/vector:ro
29 changes: 29 additions & 0 deletions transform-metrics/vector/vector.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[sources.vector_metrics]
type = "internal_metrics"
scrape_interval_secs = 5

[transforms.limit_cardinality]
type = "tag_cardinality_limit"
inputs = ["vector_metrics"]
mode = "exact"

# Change the namespace and add tags to each metric; conditionally change
# the metric name
[transforms.modify_metrics]
type = "remap"
inputs = ["limit_cardinality"]
source = '''
if .name == "utilization" {
.name = "component_utilization"
}

.tags = {
"env": "staging"
}
'''

[sinks.console_out]
type = "console"
inputs = ["modify_metrics"]
target = "stdout"
encoding = { codec = "json" }