-
Notifications
You must be signed in to change notification settings - Fork 2
/
vector-ops-log.toml
67 lines (56 loc) · 1.48 KB
/
vector-ops-log.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[sources.in]
type = "stdin"
[sinks.ddog]
type = "datadog_metrics"
inputs = [ "to_metric" ]
api_key = "${DATADOG_API_KEY}"
default_namespace = "tb"
region = "${DATADOG_REGION}"
[sinks.console]
inputs = ["parse"]
type = "console"
encoding.codec = "json"
[sinks.tinybird]
inputs = ["parse"]
type = "http"
uri = "https://${TB_HOST}.tinybird.co/v0/events?name=datadog_integration&token=${TB_TOKEN}"
encoding.codec = "ndjson"
encoding.only_fields = ["pipeline", "timestamp"]
[transforms.parse]
type = "remap"
inputs = [ "in" ]
source = """
. = parse_json!(.message)
.timestamp = to_timestamp!(.timestamp)
.pipeline = "ops_log"
"""
[transforms.to_metric]
type = "log_to_metric"
inputs = [ "parse" ]
[[transforms.to_metric.metrics]]
field = "elapsed_time"
name = "duration"
namespace = "tb.datasources"
type = "gauge"
[transforms.to_metric.metrics.tags]
datasource = "{{datasource_name}}"
event_type = "{{event_type}}"
status = "{{result}}"
[[transforms.to_metric.metrics]]
field = "rows"
namespace = "tb.datasources"
type = "counter"
increment_by_value = true
[transforms.to_metric.metrics.tags]
datasource = "{{datasource_name}}"
event_type = "{{event_type}}"
status = "{{result}}"
[[transforms.to_metric.metrics]]
field = "count"
namespace = "tb.datasources"
type = "counter"
increment_by_value = true
[transforms.to_metric.metrics.tags]
datasource = "{{datasource_name}}"
event_type = "{{event_type}}"
status = "{{result}}"