-
Notifications
You must be signed in to change notification settings - Fork 232
/
errors.go
48 lines (39 loc) · 1.15 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package metrics
import (
"encr.dev/pkg/errors"
)
var (
errRange = errors.Range(
"metrics",
"For more information on metrics, see https://encore.dev/docs/observability/metrics",
errors.WithRangeSize(20),
)
errInvalidArgCount = errRange.Newf(
"Invalid metric construction",
"%s requires 2 arguments; the metric name and the config object, got %d arguments.",
)
errInvalidMetricType = errRange.New(
"Invalid metric construction",
"The metric value type must be a builtin type.",
)
errInvalidLabelType = errRange.New(
"Invalid metric construction",
"The metric label type must be a named struct type.",
)
errLabelNoPointer = errRange.New(
"Invalid metric construction",
"The metric label type must not be a pointer.",
)
errLabelNoAnonymous = errRange.New(
"Invalid metric label type",
"Anonymous fields are not supported in metric labels.",
)
errLabelInvalidType = errRange.New(
"Invalid metric label type",
"Invalid metric label field: must be string, bool, or integer type.",
)
errLabelReservedName = errRange.New(
"Invalid metric label name",
"Metric labels cannot be named 'service' as this is reserved by Encore.",
)
)