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

Fix prometheus frontend label inconsistencies #5087

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
3 changes: 3 additions & 0 deletions common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,8 @@ const (
const (
// AdminDescribeHistoryHostScope is the metric scope for admin.AdminDescribeHistoryHostScope
AdminDescribeHistoryHostScope = iota + NumCommonScopes
// AdminDescribeClusterScope is the metric scope for admin.AdminDescribeClusterScope
AdminDescribeClusterScope
// AdminAddSearchAttributeScope is the metric scope for admin.AdminAddSearchAttributeScope
AdminAddSearchAttributeScope
// AdminDescribeWorkflowExecutionScope is the metric scope for admin.AdminDescribeWorkflowExecutionScope
Expand Down Expand Up @@ -1552,6 +1554,7 @@ var ScopeDefs = map[ServiceIdx]map[int]scopeDefinition{
AdminMergeDLQMessagesScope: {operation: "AdminMergeDLQMessages"},
AdminDescribeHistoryHostScope: {operation: "DescribeHistoryHost"},
AdminDescribeShardDistributionScope: {operation: "AdminShardList"},
AdminDescribeClusterScope: {operation: "DescribeCluster"},
AdminAddSearchAttributeScope: {operation: "AddSearchAttribute"},
AdminDescribeWorkflowExecutionScope: {operation: "DescribeWorkflowExecution"},
AdminGetWorkflowExecutionRawHistoryScope: {operation: "GetWorkflowExecutionRawHistory"},
Expand Down
2 changes: 1 addition & 1 deletion service/frontend/accessControlledHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (a *AccessControlledWorkflowHandler) ListDomains(
request *types.ListDomainsRequest,
) (*types.ListDomainsResponse, error) {

scope := a.GetMetricsClient().Scope(metrics.FrontendListDomainsScope)
scope := a.GetMetricsClient().Scope(metrics.FrontendListDomainsScope).Tagged(metrics.DomainUnknownTag())

attr := &authorization.Attributes{
APIName: "ListDomains",
Expand Down
4 changes: 2 additions & 2 deletions service/frontend/adminHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ func (adh *adminHandlerImpl) DescribeCluster(
) (resp *types.DescribeClusterResponse, retError error) {

defer func() { log.CapturePanic(recover(), adh.GetLogger(), &retError) }()
scope, sw := adh.startRequestProfile(ctx, metrics.AdminGetWorkflowExecutionRawHistoryV2Scope)
scope, sw := adh.startRequestProfile(ctx, metrics.AdminDescribeClusterScope)
defer sw.Stop()

// expose visibility store backend and if advanced options are available
Expand Down Expand Up @@ -1544,7 +1544,7 @@ func (adh *adminHandlerImpl) validatePaginationToken(

// startRequestProfile initiates recording of request metrics
func (adh *adminHandlerImpl) startRequestProfile(ctx context.Context, scope int) (metrics.Scope, metrics.Stopwatch) {
metricsScope := adh.GetMetricsClient().Scope(scope).Tagged(metrics.GetContextTags(ctx)...)
metricsScope := adh.GetMetricsClient().Scope(scope).Tagged(metrics.DomainUnknownTag()).Tagged(metrics.GetContextTags(ctx)...)
sw := metricsScope.StartTimer(metrics.CadenceLatency)
metricsScope.IncCounter(metrics.CadenceRequests)
return metricsScope, sw
Expand Down