2023-04-10 15:36:59 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2023-01-26 20:04:25 +00:00
|
|
|
rules:
|
|
|
|
# Check for server RPC endpoints without metrics
|
|
|
|
- id: "rpc-missing-metrics"
|
|
|
|
patterns:
|
|
|
|
- pattern: |
|
|
|
|
authErr := $A.$B.Authenticate($A.ctx, args)
|
|
|
|
- pattern-not-inside: |
|
|
|
|
authErr := $A.$B.Authenticate($A.ctx, args)
|
|
|
|
...
|
|
|
|
$T.srv.MeasureRPCRate(...)
|
|
|
|
...
|
|
|
|
message: "RPC method appears to be missing metrics"
|
|
|
|
languages:
|
|
|
|
- "go"
|
|
|
|
severity: "WARNING"
|
|
|
|
paths:
|
|
|
|
include:
|
|
|
|
- "nomad/*_endpoint.go"
|