diff --git a/PORT_MAP.md b/PORT_MAP.md index d950be5..05ea28d 100644 --- a/PORT_MAP.md +++ b/PORT_MAP.md @@ -33,6 +33,7 @@ Rule of thumb: keep ports below 10000 free for stuff that reserves ports. | 20080 | matrix-synapse | client, federation | | 20081 | matrix-synapse | prometheus metrics | | 20090 | matrix-media-repo | media_repo | +| 20090 | matrix-media-repo | prometheus metrics | | 21000 | pleroma | pleroma | | 21010 | grafana | grafana | | 22000 | gitea | gitea | diff --git a/bundles/hedgedoc/metadata.py b/bundles/hedgedoc/metadata.py index 5137515..fff3ccb 100644 --- a/bundles/hedgedoc/metadata.py +++ b/bundles/hedgedoc/metadata.py @@ -73,25 +73,24 @@ defaults = { }, } - if node.has_bundle('telegraf'): defaults['telegraf'] = { 'input_plugins': { - 'builtin': { - 'http': [{ + 'http': { + 'hedgedoc_status': { 'urls': [ 'http://127.0.0.1:3000/status' ], 'data_format': 'json', - 'name_override': 'hedgedoc_status', - }], - 'prometheus': [{ + }, + }, + 'prometheus': { + 'hedgedoc': { 'urls': [ 'http://127.0.0.1:3000/metrics' ], - 'name_override': 'hedgedoc_metrics', 'metric_version': 2, - }], + }, }, }, } diff --git a/bundles/matrix-media-repo/files/config.yaml b/bundles/matrix-media-repo/files/config.yaml index 8291135..4825492 100644 --- a/bundles/matrix-media-repo/files/config.yaml +++ b/bundles/matrix-media-repo/files/config.yaml @@ -157,7 +157,7 @@ timeouts: clientServerTimeoutSeconds: 30 metrics: - enabled: false + enabled: true bindAddress: "127.0.0.1" port: 20091 diff --git a/bundles/matrix-media-repo/metadata.py b/bundles/matrix-media-repo/metadata.py index f09dce7..db3e0cf 100644 --- a/bundles/matrix-media-repo/metadata.py +++ b/bundles/matrix-media-repo/metadata.py @@ -77,6 +77,20 @@ if node.os == 'debian' and node.os_version[0] <= 10: }, } +if node.has_bundle('telegraf'): + defaults['telegraf'] = { + 'input_plugins': { + 'prometheus': { + 'matrix_media_repo': { + 'urls': [ + 'http://127.0.0.1:20091/metrics' + ], + 'metric_version': 2, + }, + }, + }, + } + @metadata_reactor.provides( 'matrix-media-repo/workers', diff --git a/bundles/matrix-synapse/metadata.py b/bundles/matrix-synapse/metadata.py index 20a6e04..e845523 100644 --- a/bundles/matrix-synapse/metadata.py +++ b/bundles/matrix-synapse/metadata.py @@ -65,6 +65,20 @@ defaults = { }, } +if node.has_bundle('telegraf'): + defaults['telegraf'] = { + 'input_plugins': { + 'prometheus': { + 'matrix_synapse': { + 'urls': [ + 'http://[::1]:20081/_synapse/metrics' + ], + 'metric_version': 2, + }, + }, + }, + } + @metadata_reactor.provides( 'nginx/vhosts', diff --git a/bundles/telegraf/items.py b/bundles/telegraf/items.py index 18bd0ee..01b862b 100644 --- a/bundles/telegraf/items.py +++ b/bundles/telegraf/items.py @@ -77,6 +77,20 @@ for name, config in sorted(node.metadata.get('telegraf/input_plugins/tail', {}). telegraf_config['inputs']['tail'].append(config) +for name, config in sorted(node.metadata.get('telegraf/input_plugins/http', {}).items()): + if 'http' not in telegraf_config['inputs']: + telegraf_config['inputs']['http'] = [] + + config['name_override'] = name + telegraf_config['inputs']['http'].append(config) + +for name, config in sorted(node.metadata.get('telegraf/input_plugins/prometheus', {}).items()): + if 'prometheus' not in telegraf_config['inputs']: + telegraf_config['inputs']['prometheus'] = [] + + config['name_override'] = f'{name}_metrics' + telegraf_config['inputs']['prometheus'].append(config) + files = { '/etc/telegraf/telegraf.conf': { 'content_type': 'mako',