Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
titaneric committed Jan 7, 2025
1 parent 32ed91d commit 5d4b386
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions website/cue/reference/components/transforms/log_to_metric.cue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ components: transforms: log_to_metric: {
},
{
title: "Sum"
notes: "In this example we'll demonstrate computing a sum by computing the total of orders placed."
notes: "In this example we'll demonstrate computing a sum by computing the total of orders placed, and we are trying the tags expansion feature."

configuration: {
metrics: [
Expand All @@ -89,22 +89,26 @@ components: transforms: log_to_metric: {
name: "order_total"
increment_by_value: true
tags: {
host: "{{host}}"
"*": "{{labels}}"
}
},
]
}

input: log: {
host: "10.22.11.222"
message: "Order placed for $122.20"
total: 122.2
labels: {
host: "10.22.11.222"
hostname: "vector-dev"
}
total: 122.2
}
output: [{metric: {
kind: "incremental"
name: "order_total"
tags: {
host: "10.22.11.222"
host: "10.22.11.222"
hostname: "vector-dev"
}
counter: {
value: 122.2
Expand Down

0 comments on commit 5d4b386

Please sign in to comment.