From 7f29d474e14291ebc3bdb4e829359ef62b6f123b Mon Sep 17 00:00:00 2001 From: Naren Date: Thu, 16 Feb 2023 07:11:24 -0800 Subject: [PATCH] impr: BB-361 update metric names --- extensions/replication/ReplicationMetrics.js | 6 ++--- extensions/replication/constants.js | 8 +++---- .../queueProcessor/QueueProcessor.js | 22 +++++++++---------- .../ReplicationStatusProcessor.js | 20 ++++++++--------- lib/constants.js | 8 +++---- lib/queuePopulator/QueuePopulator.js | 10 ++++----- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/extensions/replication/ReplicationMetrics.js b/extensions/replication/ReplicationMetrics.js index 876b424d3..b8afb108a 100644 --- a/extensions/replication/ReplicationMetrics.js +++ b/extensions/replication/ReplicationMetrics.js @@ -28,21 +28,21 @@ const TIME_BUCKETS = [0.03, 0.1, 0.3, 1, 3, 10, 30, 100, 300, 1000, 3000]; const replicationQueuedTotal = ZenkoMetrics.createCounter({ name: promMetricNames.replicationQueuedTotal, - help: 'Number of objects queued for replication', + help: 'Total number of objects queued for replication', labelNames: ['origin', 'partition', 'fromLocation', 'fromLocationType', 'toLocation', 'toLocationType'], }); const replicationQueuedBytes = ZenkoMetrics.createCounter({ name: promMetricNames.replicationQueuedBytes, - help: 'Number of bytes queued for replication', + help: 'Total number of bytes queued for replication', labelNames: ['origin', 'partition', 'fromLocation', 'fromLocationType', 'toLocation', 'toLocationType'], }); const replicationProcessedBytes = ZenkoMetrics.createCounter({ name: promMetricNames.replicationProcessedBytes, - help: 'Number of bytes replicated', + help: 'Total number of bytes replicated', labelNames: ['origin', 'fromLocation', 'fromLocationType', 'toLocation', 'toLocationType', 'status'], }); diff --git a/extensions/replication/constants.js b/extensions/replication/constants.js index 3ba3c2619..dda82ad31 100644 --- a/extensions/replication/constants.js +++ b/extensions/replication/constants.js @@ -9,10 +9,10 @@ const constants = { metricsExtension: 'crr', metricsTypeQueued: 'queued', promMetricNames: { - replicationQueuedTotal: 'zenko_replication_queued_total', - replicationQueuedBytes: 'zenko_replication_queued_bytes', - replicationProcessedBytes: 'zenko_replication_processed_bytes', - replicationElapsedSeconds: 'zenko_replication_elapsed_seconds', + replicationQueuedTotal: 's3_replication_queued_objects_total', + replicationQueuedBytes: 's3_replication_queued_bytes_total', + replicationProcessedBytes: 's3_replication_processed_bytes_total', + replicationElapsedSeconds: 's3_replication_elapsed_seconds', }, metricsTypeProcessed: 'processed', redisKeys: { diff --git a/extensions/replication/queueProcessor/QueueProcessor.js b/extensions/replication/queueProcessor/QueueProcessor.js index a32e133a2..4fd4975a8 100644 --- a/extensions/replication/queueProcessor/QueueProcessor.js +++ b/extensions/replication/queueProcessor/QueueProcessor.js @@ -47,55 +47,55 @@ promClient.register.setDefaultLabels({ */ const dataReplicationStatusMetric = new promClient.Counter({ - name: 'replication_data_status_changed_total', + name: 's3_replication_data_status_changed_total', help: 'Number of status updates', labelNames: ['origin', 'containerName', 'replicationStatus'], }); const metadataReplicationStatusMetric = new promClient.Counter({ - name: 'replication_metadata_status_changed_total', + name: 's3_replication_metadata_status_changed_total', help: 'Number of status updates', labelNames: ['origin', 'containerName', 'replicationStatus'], }); const kafkaLagMetric = new promClient.Gauge({ - name: 'kafka_lag', + name: 's3_zenko_queue_lag', help: 'Number of update entries waiting to be consumed from the Kafka topic', labelNames: ['origin', 'containerName', 'partition', 'serviceName'], }); const dataReplicationBytesMetric = new promClient.Counter({ - name: 'replication_data_bytes', + name: 's3_replication_data_bytes_total', help: 'Total number of bytes replicated for data operation', labelNames: ['origin', 'containerName', 'serviceName'], }); const metadataReplicationBytesMetric = new promClient.Counter({ - name: 'replication_metadata_bytes', + name: 's3_replication_metadata_bytes_total', help: 'Total number of bytes replicated for metadata operation', labelNames: ['origin', 'containerName', 'serviceName'], }); const sourceDataBytesMetric = new promClient.Counter({ - name: 'replication_source_data_bytes', + name: 's3_replication_source_data_bytes_total', help: 'Total number of data bytes read from replication source', labelNames: ['origin', 'containerName', 'serviceName'], }); const readMetric = new promClient.Counter({ - name: 'replication_data_read', - help: 'Number of read operations', + name: 's3_replication_data_read_total', + help: 'Total number of read operations', labelNames: ['origin', 'containerName', 'serviceName'], }); const writeMetric = new promClient.Counter({ - name: 'replication_data_write', - help: 'Number of write operations', + name: 's3_replication_data_write_total', + help: 'Total number of write operations', labelNames: ['origin', 'containerName', 'serviceName', 'replicationContent'], }); const timeElapsedMetric = new promClient.Histogram({ - name: 'replication_stage_time_elapsed', + name: 's3_replication_stage_time_elapsed', help: 'Elapsed time of a specific stage in replication', labelNames: ['origin', 'containerName', 'serviceName', 'replicationStage'], }); diff --git a/extensions/replication/replicationStatusProcessor/ReplicationStatusProcessor.js b/extensions/replication/replicationStatusProcessor/ReplicationStatusProcessor.js index 7a0df0356..26185797a 100644 --- a/extensions/replication/replicationStatusProcessor/ReplicationStatusProcessor.js +++ b/extensions/replication/replicationStatusProcessor/ReplicationStatusProcessor.js @@ -60,62 +60,62 @@ promClient.register.setDefaultLabels({ */ function loadMetricHandlers(repConfig) { const replicationStatusMetric = new promClient.Counter({ - name: 'replication_status_changed_total', + name: 's3_replication_status_changed_total', help: 'Number of objects updated', labelNames: ['origin', 'containerName', 'replicationStatus'], }); const kafkaLagMetric = new promClient.Gauge({ - name: 'kafka_lag', + name: 's3_zenko_queue_lag', help: 'Number of update entries waiting to be consumed from the Kafka topic', labelNames: ['origin', 'containerName', 'partition', 'serviceName'], }); const replayAttempts = new promClient.Counter({ - name: 'replication_replay_attempts_total', + name: 's3_replication_replay_attempts_total', help: 'Number of total attempts made to replay replication', labelNames: ['origin', 'containerName'], }); const replaySuccess = new promClient.Counter({ - name: 'replication_replay_success_total', + name: 's3_replication_replay_success_total', help: 'Number of times an object was replicated during a replay', labelNames: ['origin', 'containerName'], }); const replayQueuedObjects = new promClient.Counter({ - name: 'replication_replay_objects_queued_total', + name: 's3_replication_replay_objects_queued_total', help: 'Number of objects added to replay queues', labelNames: ['origin', 'containerName'], }); const replayQueuedBytes = new promClient.Counter({ - name: 'replication_replay_bytes_queued_total', + name: 's3_replication_replay_bytes_queued_total', help: 'Number of bytes added to replay queues', labelNames: ['origin', 'containerName'], }); const replayQueuedFileSizes = new promClient.Histogram({ - name: 'replication_replay_file_sizes_queued', + name: 's3_replication_replay_file_sizes_queued', help: 'Number of objects queued for replay by file size', labelNames: ['origin', 'containerName'], buckets: repConfig.objectSizeMetrics, }); const replayCompletedObjects = new promClient.Counter({ - name: 'replication_replay_objects_completed_total', + name: 's3_replication_replay_objects_completed_total', help: 'Number of objects completed from replay queues', labelNames: ['origin', 'containerName'], }); const replayCompletedBytes = new promClient.Counter({ - name: 'replication_replay_bytes_completed_total', + name: 's3_replication_replay_bytes_completed_total', help: 'Number of bytes completed from replay queues', labelNames: ['origin', 'containerName'], }); const replayCompletedFileSizes = new promClient.Histogram({ - name: 'replication_replay_file_sizes_completed', + name: 's3_replication_replay_file_sizes_completed', help: 'Number of objects completed from replay by file size', labelNames: ['origin', 'containerName', 'replicationStatus'], buckets: repConfig.objectSizeMetrics, diff --git a/lib/constants.js b/lib/constants.js index 43ec2672e..895db929b 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -5,10 +5,10 @@ const constants = { statusNotConnected: 'NOT_CONNECTED', kafkaBacklogMetrics: { promMetricNames: { - latestPublishedMessageTimestamp: 'zenko_queue_latest_published_message_timestamp', - deliveryReportsTotal: 'zenko_queue_delivery_reports_total', - latestConsumedMessageTimestamp: 'zenko_queue_latest_consumed_message_timestamp', - latestConsumeEventTimestamp: 'zenko_queue_latest_consume_event_timestamp', + latestPublishedMessageTimestamp: 's3_zenko_queue_latest_published_message_timestamp', + deliveryReportsTotal: 's3_zenko_queue_delivery_reports_total', + latestConsumedMessageTimestamp: 's3_zenko_queue_latest_consumed_message_timestamp', + latestConsumeEventTimestamp: 's3_zenko_queue_latest_consume_event_timestamp', }, }, authTypeAssumeRole: 'assumeRole', diff --git a/lib/queuePopulator/QueuePopulator.js b/lib/queuePopulator/QueuePopulator.js index 47ccf22ff..5793d71e2 100644 --- a/lib/queuePopulator/QueuePopulator.js +++ b/lib/queuePopulator/QueuePopulator.js @@ -32,31 +32,31 @@ promClient.register.setDefaultLabels({ */ const logReadOffsetMetric = new promClient.Gauge({ - name: 'replication_read_offset', + name: 's3_replication_read_offset', help: 'Current read offset of metadata journal', labelNames: metricLabels, }); const logSizeMetric = new promClient.Gauge({ - name: 'replication_log_size', + name: 's3_replication_log_size', help: 'Current size of metadata journal', labelNames: metricLabels, }); const messageMetrics = new promClient.Counter({ - name: 'replication_populator_messages', + name: 's3_replication_populator_messages_total', help: 'Total number of Kafka messages produced by the queue populator', labelNames: ['origin', 'logName', 'logId', 'containerName', 'publishStatus'], }); const objectMetrics = new promClient.Counter({ - name: 'replication_populator_objects', + name: 's3_replication_populator_objects_total', help: 'Total objects queued for replication', labelNames: metricLabels, }); const byteMetrics = new promClient.Counter({ - name: 'replication_populator_bytes', + name: 's3_replication_populator_bytes_total', help: 'Total number of bytes queued for replication not including metadata', labelNames: metricLabels, });