Skip to content

Commit fdc4953

Browse files
authored
Merge pull request #47 from richm/collect-ovirt
no _source or _all for collectd metrics
2 parents 4a699cf + 195d475 commit fdc4953

File tree

9 files changed

+75
-10
lines changed

9 files changed

+75
-10
lines changed

namespaces/_default_.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2017.05.23.0
1+
version: 2017.06.06.0
22

33
field_defaults:
44
type: string
@@ -14,7 +14,7 @@ _default_:
1414
fields:
1515
- name: "@timestamp"
1616
type: date
17-
format: yyyy-MM-dd'T'HH:mm:ss.SSSSSSZ||yyyy-MM-dd'T'HH:mm:ssZ||dateOptionalTime
17+
format: yyyy-MM-dd HH:mm:ss,SSSZ||yyyy-MM-dd'T'HH:mm:ss.SSSSSSZ||yyyy-MM-dd'T'HH:mm:ssZ||dateOptionalTime
1818
example: 2015-01-24T14:06:05.071Z
1919
description: >
2020
UTC value marking when the log payload was created, or when log payload was first collected if the creation time is not known;

namespaces/collectd.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,43 @@ namespace:
66
fields:
77
- name: interval
88
type: float
9+
include_in_all: false
910
description: >
1011
Collectd's interval.
1112
1213
- name: plugin
1314
type: string
15+
include_in_all: false
1416
description: >
1517
Collectd's plugin.
1618
1719
- name: plugin_instance
1820
type: string
21+
include_in_all: false
1922
description: >
2023
Collectd's plugin_instance.
2124
2225
- name: type_instance
2326
type: string
27+
include_in_all: false
2428
description: >
2529
Collectd's type_instance.
2630
2731
- name: type
2832
type: string
33+
include_in_all: false
2934
description: >
3035
Collectd's type.
3136
3237
- name: dstypes
3338
type: string
39+
include_in_all: false
3440
description: >
3541
Collectd's dstypes.
3642
3743
- name: processes
3844
type: group
45+
include_in_all: false
3946
description: >
4047
Corresponds to collectd's processes plugin.
4148
fields:
@@ -154,6 +161,7 @@ namespace:
154161
type: group
155162
description: >
156163
Corresponds to collectd's disk plugin.
164+
include_in_all: false
157165
fields:
158166
- name: disk_merged
159167
type: group
@@ -239,6 +247,7 @@ namespace:
239247
type: group
240248
description: >
241249
Corresponds to collectd's interface plugin.
250+
include_in_all: false
242251
fields:
243252
- name: if_octets
244253
type: group
@@ -302,6 +311,7 @@ namespace:
302311
303312
- name: virt
304313
type: group
314+
include_in_all: false
305315
description: >
306316
Corresponds to collectd's virt plugin.
307317
fields:
@@ -412,6 +422,7 @@ namespace:
412422
413423
- name: CPU
414424
type: group
425+
include_in_all: false
415426
description: >
416427
Corresponds to collectd's CPU plugin.
417428
fields:
@@ -422,6 +433,7 @@ namespace:
422433
423434
- name: df
424435
type: group
436+
include_in_all: false
425437
description: >
426438
Corresponds to collectd's df plugin.
427439
fields:
@@ -438,6 +450,7 @@ namespace:
438450
439451
- name: entropy
440452
type: group
453+
include_in_all: false
441454
description: >
442455
Corresponds to collectd's entropy plugin.
443456
fields:
@@ -451,6 +464,7 @@ namespace:
451464
type: group
452465
description: >
453466
Corresponds to collectd's nfs plugin.
467+
include_in_all: false
454468
fields:
455469

456470
- name: nfs_procedure
@@ -462,6 +476,7 @@ namespace:
462476
type: group
463477
description: >
464478
Corresponds to collectd's memory plugin.
479+
include_in_all: false
465480
fields:
466481

467482
- name: memory
@@ -478,6 +493,7 @@ namespace:
478493
type: group
479494
description: >
480495
Corresponds to collectd's swap plugin.
496+
include_in_all: false
481497
fields:
482498

483499
- name: swap
@@ -494,6 +510,7 @@ namespace:
494510
type: group
495511
description: >
496512
Corresponds to collectd's load plugin.
513+
include_in_all: false
497514
fields:
498515
- name: load
499516
type: group
@@ -519,6 +536,7 @@ namespace:
519536
type: group
520537
description: >
521538
Corresponds to collectd's aggregation plugin.
539+
include_in_all: false
522540
fields:
523541

524542
- name: percent
@@ -530,6 +548,7 @@ namespace:
530548
type: group
531549
description: >
532550
Corresponds to collectd's statsd plugin.
551+
include_in_all: false
533552
fields:
534553

535554
- name: host_cpu
@@ -731,6 +750,7 @@ namespace:
731750
type: group
732751
description: >
733752
Corresponds to collectd's postgresql plugin.
753+
include_in_all: false
734754
fields:
735755

736756
- name: pg_n_tup_g

namespaces/kubernetes.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ namespace:
77
fields:
88
- name: pod_name
99
type: string
10+
norms:
11+
enabled: true
1012
description: >
1113
The name of the pod
1214
@@ -20,21 +22,29 @@ namespace:
2022
2123
- name: pod_id
2224
type: string
25+
norms:
26+
enabled: true
2327
description: >
2428
Kubernetes ID of the pod.
2529
2630
- name: namespace_name
2731
type: string
32+
norms:
33+
enabled: true
2834
description: >
2935
The name of the namespace in Kubernetes.
3036
3137
- name: namespace_id
3238
type: string
39+
norms:
40+
enabled: true
3341
description: >
3442
ID of the namespace in Kubernetes.
3543
3644
- name: host
3745
type: string
46+
norms:
47+
enabled: true
3848
description: >
3949
Kubernetes node name
4050

scripts/concat-index-pattern-fields.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,26 @@
44
import json
55

66
doc = {}
7+
names = {}
8+
9+
def removedupnames(fieldary):
10+
ret = []
11+
for field in fieldary:
12+
if not field['name'] in names:
13+
names[field['name']] = True
14+
ret.append(field)
15+
return ret
16+
717
for filename in sys.argv[1:]:
818
with open(filename, "r") as ff:
919
if doc:
1020
d2 = json.load(ff)
11-
d2fieldary = json.loads(d2['fields'])
21+
d2fieldary = removedupnames(json.loads(d2['fields']))
1222
docfieldary = json.loads(doc['fields'])
1323
docfieldary.extend(d2fieldary)
1424
doc['fields'] = json.dumps(docfieldary)
1525
else:
1626
doc = json.load(ff)
17-
sys.stdout.write(json.dumps(doc, indent=4, sort_keys=True))
27+
docfieldary = removedupnames(json.loads(doc['fields']))
28+
doc['fields'] = json.dumps(docfieldary)
29+
sys.stdout.write(json.dumps(doc, indent=4, sort_keys=True, separators=(',', ': ')))

scripts/generate_template.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def object_types_to_template(template_definition, output, output_index_pattern,
7777

7878
json.dump(
7979
skeleton, output, indent=2, separators=(',', ': '), sort_keys=True)
80+
output.write('\n')
8081

8182
# index pattern stuff
8283
time_field_name = "time"
@@ -92,6 +93,7 @@ def object_types_to_template(template_definition, output, output_index_pattern,
9293
skeleton_index_pattern["fields"] = json.dumps(index_pattern_fields)
9394
json.dump(
9495
skeleton_index_pattern, output_index_pattern, indent=2, separators=(',', ': '), sort_keys=True)
96+
output_index_pattern.write('\n')
9597

9698

9799
def add_mapping_to_skeleton(map_type, skeleton):

templates/collectd_metrics/template.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
skeleton_path: ../skeleton.json
22
skeleton_index_pattern_path: ../skeleton-index-pattern.json
33

4+
# exclude all collectd stats fields from _source
45
elasticsearch_template:
56
name: org.ovirt.viaq-collectd
67
index_pattern: "project.ovirt-metrics-*"
7-
order: 10
8+
order: 20
9+
_source:
10+
excludes:
11+
- collectd.*
812

913
namespaces:
1014
- collectd.yml

templates/openshift/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
TEMPLATE_NAME = com.redhat.viaq-openshift
2-
31
.PHONY: all clean
42

53
all:
6-
python ../../scripts/generate_template.py template.yml ../../namespaces/
4+
python ../../scripts/generate_template.py template-project.yml ../../namespaces/
5+
python ../../scripts/generate_template.py template-operations.yml ../../namespaces/
76

87
clean:
98
rm *.template.json
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
skeleton_path: ../skeleton.json
2+
skeleton_index_pattern_path: ../skeleton-index-pattern.json
3+
4+
elasticsearch_template:
5+
name: com.redhat.viaq-openshift-operations
6+
index_pattern: ".operations.*"
7+
order: 10
8+
9+
namespaces:
10+
- rsyslog.yml
11+
- systemd.yml
12+
- kubernetes.yml
13+
- docker.yml
14+
- pipeline_metadata.yml
15+
- ovirt.yml
16+
- aushape.yml
17+
- tlog.yml
18+
# - openshift/app_log.yml

templates/openshift/template.yml renamed to templates/openshift/template-project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ skeleton_path: ../skeleton.json
22
skeleton_index_pattern_path: ../skeleton-index-pattern.json
33

44
elasticsearch_template:
5-
name: com.redhat.viaq-openshift
6-
index_pattern: "*"
5+
name: com.redhat.viaq-openshift-project
6+
index_pattern: "project.*"
77
order: 10
88

99
namespaces:

0 commit comments

Comments
 (0)