Skip to content

Commit b6959a2

Browse files
Copilotalvarolopez
andcommitted
docs: add documentation for messenger record type filtering
Co-authored-by: alvarolopez <[email protected]>
1 parent 5be94e7 commit b6959a2

File tree

2 files changed

+205
-23
lines changed

2 files changed

+205
-23
lines changed

doc/source/configuration.rst

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,75 @@ messenger. Available options:
208208
* ``host`` (default: ``localhost``), host of Logstash server.
209209
* ``port`` (default: ``5000``), Logstash server port.
210210

211+
Messenger record type filtering
212+
-------------------------------
213+
214+
Each messenger can be configured to only receive specific record types. This allows
215+
you to control which types of accounting records are published to each messenger.
216+
217+
The configuration is done via ``[messenger_<name>]`` sections, where ``<name>`` is
218+
the messenger name (e.g., ``ssm``, ``logstash``, ``noop``). Each section supports
219+
the following option:
220+
221+
* ``record_types`` (list value). List of record types to publish to this messenger.
222+
Valid values are: ``cloud``, ``ip``, ``accelerator``, ``storage``, ``energy``.
223+
If empty, all record types will be published.
224+
225+
The following record types are available:
226+
227+
.. list-table:: Record types and their extractors
228+
:header-rows: 1
229+
230+
* - Record Type
231+
- Extractor
232+
- Description
233+
234+
* - ``cloud``
235+
- ``nova``
236+
- VM/compute accounting records
237+
238+
* - ``ip``
239+
- ``neutron``
240+
- Public IP usage records
241+
242+
* - ``accelerator``
243+
- ``nova``
244+
- Accelerator (GPU) usage records
245+
246+
* - ``storage``
247+
- ``cinder``
248+
- Block storage records
249+
250+
* - ``energy``
251+
- ``prometheus``
252+
- Energy consumption records
253+
254+
**Default behavior:**
255+
256+
* For ``ssm`` and ``ssmv4`` messengers, the default is to publish only records from
257+
the default extractors (``nova``, ``cinder``, ``neutron``), which means:
258+
``cloud``, ``ip``, ``accelerator``, ``storage``. Energy records are not published
259+
by default to SSM.
260+
* For other messengers (``logstash``, ``noop``), all record types are published by
261+
default.
262+
263+
**Example configuration:**
264+
265+
To publish only cloud and storage records to SSM::
266+
267+
[messenger_ssm]
268+
record_types = cloud,storage
269+
270+
To publish all record types including energy records to SSM::
271+
272+
[messenger_ssm]
273+
record_types = cloud,ip,accelerator,storage,energy
274+
275+
To publish only energy records to logstash::
276+
277+
[messenger_logstash]
278+
record_types = energy
279+
211280
``[prometheus]`` section
212281
------------------------
213282

doc/source/static/caso.conf.sample

Lines changed: 136 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
#
66

77
# List of messengers that will dispatch records. valid values are
8-
# logstash,noop,ssmv4. You can specify more than one messenger. (list value)
8+
# logstash,noop,ssm,ssmv4. You can specify more than one messenger. (list
9+
# value)
910
#messengers = noop
1011

1112
# Spool directory. (string value)
@@ -18,7 +19,6 @@
1819

1920
# Extract records but do not push records to SSM. This will not update the last
2021
# run date. (boolean value)
21-
# Deprecated group/name - [DEFAULT]/dry_run
2222
#dry_run = false
2323

2424
# Site name as in GOCDB. (string value)
@@ -27,19 +27,32 @@
2727
# Service name within the site (string value)
2828
#service_name = $site_name
2929

30-
# List of projects to extract accounting records from. (list value)
31-
# Deprecated group/name - [DEFAULT]/tenants
30+
# List of projects to extract accounting records from. You can use this option,
31+
# or add 'caso' tag to the project in Keystone. Please refer to the
32+
# documentation for more details. (list value)
3233
#projects =
3334

34-
# File containing the VO <-> project mapping as used in Keystone-VOMS. (string
35+
# Tag used to mark a project in Keystone to be extracted by cASO (string value)
36+
#caso_tag = caso
37+
38+
# Property key used to get the VO name from the project properties. (string
3539
# value)
40+
#vo_property = VO
41+
42+
# DEPRECATED: File containing the VO <-> project mapping as used in Keystone-
43+
# VOMS. (string value)
44+
# This option is deprecated for removal.
45+
# Its value may be silently ignored in the future.
46+
# Reason: This option is marked for removal in the next release. Please see the
47+
# release notes, and migrate your current configuration to use the new project
48+
# mapping as soon as possible. If you already migrated your configuration,
49+
# please remove the JSON file to get rid of this message.
3650
#mapping_file = /etc/caso/voms.json
3751

3852
# Extract record changes until this date. If it is not set, we use now. If a
3953
# server has ended after this date, it will be included, but the consuption
4054
# reported will end on this date. If no time zone is specified, UTC will be
4155
# used. (string value)
42-
# Deprecated group/name - [DEFAULT]/extract_to
4356
#extract_to = <None>
4457

4558
# Extract records that have changed after this date. This means that if a
@@ -48,13 +61,12 @@
4861
# If it is not set, extract records from last run. If it is set to None and
4962
# last run file is not present, it will extract records from the beginning of
5063
# time. If no time zone is specified, UTC will be used. (string value)
51-
# Deprecated group/name - [DEFAULT]/extract_from
5264
#extract_from = <None>
5365

5466
# Which extractor to use for getting the data. If you do not specify anything,
55-
# nova will be used. Available choices are frozenset({'neutron', 'nova'}) (list
56-
# value)
57-
#extractor = nova
67+
# nova will be used. Available choices are ['cinder', 'neutron', 'nova',
68+
# 'prometheus'] (list value)
69+
#extractor = nova,cinder,neutron
5870

5971
#
6072
# From oslo.config
@@ -111,11 +123,15 @@
111123
# Deprecated group/name - [DEFAULT]/logdir
112124
#log_dir = <None>
113125

114-
# Uses logging handler designed to watch file system. When log file is moved or
115-
# removed this handler will open a new log file with specified path
126+
# DEPRECATED: Uses logging handler designed to watch file system. When log file
127+
# is moved or removed this handler will open a new log file with specified path
116128
# instantaneously. It makes sense only if log_file option is specified and
117129
# Linux platform is used. This option is ignored if log_config_append is set.
118130
# (boolean value)
131+
# This option is deprecated for removal.
132+
# Its value may be silently ignored in the future.
133+
# Reason: This function is known to have bene broken for long time, and depends
134+
# on the unmaintained library
119135
#watch_log_file = false
120136

121137
# Use syslog for logging. Existing syslog format is DEPRECATED and will be
@@ -141,9 +157,17 @@
141157
# set. (boolean value)
142158
#use_stderr = false
143159

144-
# Log output to Windows Event Log. (boolean value)
160+
# DEPRECATED: Log output to Windows Event Log. (boolean value)
161+
# This option is deprecated for removal.
162+
# Its value may be silently ignored in the future.
163+
# Reason: Windows support is no longer maintained.
145164
#use_eventlog = false
146165

166+
# (Optional) Set the 'color' key according to log levels. This option takes
167+
# effect only when logging to stderr or stdout is used. This option is ignored
168+
# if log_config_append is set. (boolean value)
169+
#log_color = false
170+
147171
# The amount of time before the log files are rotated. This option is ignored
148172
# unless log_rotation_type is set to "interval". (integer value)
149173
#log_rotate_interval = 1
@@ -216,10 +240,16 @@
216240
# Maximum number of logged messages per rate_limit_interval. (integer value)
217241
#rate_limit_burst = 0
218242

219-
# Log level name used by rate limiting: CRITICAL, ERROR, INFO, WARNING, DEBUG
220-
# or empty string. Logs with level greater or equal to rate_limit_except_level
221-
# are not filtered. An empty string means that all levels are filtered. (string
222-
# value)
243+
# Log level name used by rate limiting. Logs with level greater or equal to
244+
# rate_limit_except_level are not filtered. An empty string means that all
245+
# levels are filtered. (string value)
246+
# Possible values:
247+
# CRITICAL - <No description provided>
248+
# ERROR - <No description provided>
249+
# INFO - <No description provided>
250+
# WARNING - <No description provided>
251+
# DEBUG - <No description provided>
252+
# '' - <No description provided>
223253
#rate_limit_except_level = CRITICAL
224254

225255
# Enables or disables fatal status of deprecations. (boolean value)
@@ -234,22 +264,18 @@
234264

235265
# Metadata key used to retrieve the accelerator type from the flavor
236266
# properties. (string value)
237-
# Deprecated group/name - [DEFAULT]/accelerator_type_key
238267
#type_key = Accelerator:Type
239268

240269
# Metadata key used to retrieve the accelerator vendor from the flavor
241270
# properties. (string value)
242-
# Deprecated group/name - [DEFAULT]/accelerator_vendor_key
243271
#vendor_key = Accelerator:Vendor
244272

245273
# Metadata key used to retrieve the accelerator model from the flavor
246274
# properties. (string value)
247-
# Deprecated group/name - [DEFAULT]/accelerator_model_key
248275
#model_key = Accelerator:Model
249276

250277
# Metadata key used to retrieve the accelerator number from the flavor
251278
# properties. (string value)
252-
# Deprecated group/name - [DEFAULT]/accelerator_number_key
253279
#number_key = Accelerator:Number
254280

255281

@@ -261,12 +287,10 @@
261287

262288
# Metadata key used to retrieve the benchmark type from the flavor properties.
263289
# (string value)
264-
# Deprecated group/name - [DEFAULT]/benchmark_name_key
265290
#name_key = accounting:benchmark_type
266291

267292
# Metadata key used to retrieve the benchmark value from the flavor properties.
268293
# (string value)
269-
# Deprecated group/name - [DEFAULT]/benchmark_value_key
270294
#value_key = accounting:benchmark_value
271295

272296

@@ -374,6 +398,91 @@
374398
#port = 5000
375399

376400

401+
[messenger_logstash]
402+
403+
#
404+
# From caso
405+
#
406+
407+
# List of record types to publish to this messenger. Valid values are: cloud,
408+
# ip, accelerator, storage, energy. If empty, all record types will be
409+
# published. Default for logstash: all record types. (list value)
410+
#record_types =
411+
412+
413+
[messenger_noop]
414+
415+
#
416+
# From caso
417+
#
418+
419+
# List of record types to publish to this messenger. Valid values are: cloud,
420+
# ip, accelerator, storage, energy. If empty, all record types will be
421+
# published. Default for noop: all record types. (list value)
422+
#record_types =
423+
424+
425+
[messenger_ssm]
426+
427+
#
428+
# From caso
429+
#
430+
431+
# List of record types to publish to this messenger. Valid values are: cloud,
432+
# ip, accelerator, storage, energy. If empty, all record types will be
433+
# published. Default for ssm: ['cloud', 'ip', 'accelerator', 'storage']. (list
434+
# value)
435+
#record_types = cloud,ip,accelerator,storage
436+
437+
438+
[messenger_ssmv4]
439+
440+
#
441+
# From caso
442+
#
443+
444+
# List of record types to publish to this messenger. Valid values are: cloud,
445+
# ip, accelerator, storage, energy. If empty, all record types will be
446+
# published. Default for ssmv4: ['cloud', 'ip', 'accelerator', 'storage'].
447+
# (list value)
448+
#record_types = cloud,ip,accelerator,storage
449+
450+
451+
[prometheus]
452+
453+
#
454+
# From caso
455+
#
456+
457+
# Prometheus server endpoint URL. (string value)
458+
#prometheus_endpoint = http://localhost:9090
459+
460+
# Name of the Prometheus metric to query for energy consumption. (string value)
461+
#prometheus_metric_name = prometheus_value
462+
463+
# Name of the label that matches the VM UUID in Prometheus metrics. (string
464+
# value)
465+
#vm_uuid_label_name = uuid
466+
467+
# List of label filters as key:value pairs to filter the Prometheus metric
468+
# (e.g., 'type_instance:scaph_process_power_microwatts'). The VM UUID label
469+
# will be added automatically based on vm_uuid_label_name. (list value)
470+
#labels = type_instance:scaph_process_power_microwatts
471+
472+
# Frequency between samples in the time series (in seconds). (integer value)
473+
#prometheus_step_seconds = 30
474+
475+
# Query time range (e.g., '1h', '6h', '24h'). (string value)
476+
#prometheus_query_range = 1h
477+
478+
# Whether to verify SSL when connecting to Prometheus. (boolean value)
479+
#prometheus_verify_ssl = true
480+
481+
# CPU normalization factor to apply to energy measurements. (floating point
482+
# value)
483+
#cpu_normalization_factor = 1.0
484+
485+
377486
[sample_remote_file_source]
378487
# Example of using a remote_file source
379488
#
@@ -433,6 +542,10 @@
433542
# includes the private key. (string value)
434543
#client_key = <None>
435544

545+
# Timeout is the number of seconds the request will wait for your client to
546+
# establish a connection to a remote machine call on the socket. (string value)
547+
#timeout = 60
548+
436549

437550
[ssm]
438551

0 commit comments

Comments
 (0)