cadence icon indicating copy to clipboard operation
cadence copied to clipboard

WIP: simpler metrics option, no codegen just a small wrapper

Open Groxx opened this issue 4 months ago • 0 comments

tbd.

sample with the new linter:

❯ git diff | cat                  
service/history/replication/task_processor.go --- Go
511 511 
512 512         shardScope := p.metricsClient.Scope(scope, metrics.TargetClusterTag(p.sourceCluster), metrics.InstanceTag(strconv.Itoa(p.shard.GetShardID())))
513 513         shardScope.IncCounter(metrics.ReplicationTasksApplied)
... 514         p.metrics.Count("replication_tasks_applied", 1, p.metricTags.With("shard_id", strconv.Itoa(p.shard.GetShardID())))
514 515     }
515 516 
516 517     return err

❯ make .build/metrics-lint
linting metrics definitions...
Metric name "replication_tasks_applied" used in multiple places:
        /path/to/github.com/uber/cadence/common/metrics/defs.go:3413:66: success: replication_tasks_applied
        /path/to/github.com/uber/cadence/service/history/replication/task_processor.go:514:3: success: replication_tasks_applied
make: *** [.build/metrics-lint] Error 1

Groxx avatar Aug 27 '25 01:08 Groxx