Shift error-type tag from opCount to opErrorCount
@@ -52,14 +52,14 @@ func init() {
Measure: opCount,
Description: "The cumulative number of ops processed by the file system.",
Aggregation: view.Sum(),
- TagKeys: []tag.Key{tags.FSOp, tags.FSError},
+ TagKeys: []tag.Key{tags.FSOp},
},
&view.View{
Name: "fs/opErrorCount",
Measure: opErrorCount,
Description: "The cumulative number of errors generated by file system operations",
Aggregation: view.Sum(),
- TagKeys: []tag.Key{tags.FSOp},
+ TagKeys: []tag.Key{tags.FSOp, tags.FSError},
},
&view.View{
Name: "fs/opLatency",
@@ -85,7 +85,7 @@ func fsErrStr(err error) string {
return DefaultFSError.Error()
}
-// recordOp records file system operation count, operation error count and the operation latency
+// Records file system operation count, failed operation count and the operation latency
func recordOp(ctx context.Context, method string, start time.Time, fsErr error) {
// Recording opCount
@@ -93,7 +93,6 @@ func recordOp(ctx context.Context, method string, start time.Time, fsErr error)
ctx,
[]tag.Mutator{
tag.Upsert(tags.FSOp, method),
- tag.Upsert(tags.FSError, fsErrStr(fsErr)),
},
opCount.M(1),
); err != nil {
@@ -107,6 +106,7 @@ func recordOp(ctx context.Context, method string, start time.Time, fsErr error)
ctx,
[]tag.Mutator{
tag.Upsert(tags.FSOp, method),
+ tag.Upsert(tags.FSError, fsErrStr(fsErr)),
},
opErrorCount.M(1),
); err != nil {
