Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
add metrics for zone failover mgr
Browse files Browse the repository at this point in the history
  • Loading branch information
datoug committed Apr 18, 2017
1 parent b249347 commit 63818e3
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,13 @@ var GoRuntimeMetrics = map[MetricName]MetricType{

// Scope enum
const (
// -- Operation scopes for ZoneFailoverManager (common) --
ZoneFailoverMgrScope = iota

// -- Operation scopes for Metadata (common) --

// MetadataListEntityOpsScope defines scope for an operation on metadata
MetadataListEntityOpsScope = iota
MetadataListEntityOpsScope
// MetadataHostAddrToUUIDScope defines scope for an operation on metadata
MetadataHostAddrToUUIDScope
// MetadataListAllConsumerGroupsScope defines scope for an operation on metadata
Expand Down Expand Up @@ -458,6 +461,8 @@ var scopeDefs = map[ServiceIdx]map[int]scopeDefinition{

// Common operation tag values (shared by all services)
Common: {
ZoneFailoverMgrScope: {operation: "ZoneFailoverMgr"},

// Metadata operation tag values as seen by the Metrics backend
MetadataListEntityOpsScope: {operation: "MetadataListEntityOps"},
MetadataHostAddrToUUIDScope: {operation: "MetadataHostAddrToUUID"},
Expand Down Expand Up @@ -661,6 +666,15 @@ const (

// -- Common metrics -- //

// ZoneFailoverMgrRunSuccess indicates a success run
ZoneFailoverMgrRunSuccess = iota
// ZoneFailoverMgrRunFailToDetectActiveZone indicates failure to detect active zone
ZoneFailoverMgrRunFailToDetectActiveZone
// ZoneFailoverMgrRunFailToWriteMetadata indicates failure to write metadata
ZoneFailoverMgrRunFailToWriteMetadata
// ZoneFailoverMgrRunFailToWriteMetadata indicates a failed run
ZoneFailoverMgrRunFailure

// MetadataRequests is the count of requests to metadata
MetadataRequests = iota
// MetadataFailures is the count of requests to metadata that have failed
Expand Down Expand Up @@ -1079,9 +1093,13 @@ var metricDefs = map[ServiceIdx]map[int]metricDefinition{

// definition for Common metrics (for all services)
Common: {
MetadataRequests: {Counter, "metadata.requests"},
MetadataFailures: {Counter, "metadata.failures"},
MetadataLatency: {Timer, "metadata.latency"},
ZoneFailoverMgrRunSuccess: {Gauge, "ZoneFailoverMgr.run-success"},
ZoneFailoverMgrRunFailToDetectActiveZone: {Gauge, "ZoneFailoverMgr.run-fail-detect-active-zone"},
ZoneFailoverMgrRunFailToWriteMetadata: {Gauge, "ZoneFailoverMgr.run-fail-write-metadata"},
ZoneFailoverMgrRunFailure: {Gauge, "ZoneFailoverMgr.run-failure"},
MetadataRequests: {Counter, "metadata.requests"},
MetadataFailures: {Counter, "metadata.failures"},
MetadataLatency: {Timer, "metadata.latency"},
},

// definitions for Inputhost metrics
Expand Down

0 comments on commit 63818e3

Please sign in to comment.