Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impr: BB-361 update metric names #2367

Merged
merged 1 commit into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions extensions/replication/ReplicationMetrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
});
Expand Down
8 changes: 4 additions & 4 deletions extensions/replication/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
22 changes: 11 additions & 11 deletions extensions/replication/queueProcessor/QueueProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
10 changes: 5 additions & 5 deletions lib/queuePopulator/QueuePopulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down