uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.
https://cadenceworkflow.io
MIT License
344 stars 130 forks source link

Metrics using tally are not compatible with prometheus #1157

Closed mohakkataria closed 2 years ago

mohakkataria commented 2 years ago

Describe the bug Currently the tally version used if v3.3.5 (https://github.com/uber-go/cadence-client/blob/v0.18.5/go.mod#L16) uses a different prometheus client(https://github.com/uber-go/tally/blob/v3.3.5/prometheus/reporter.go#L31) than https://github.com/prometheus/client_golang. This means that if there any other dependency using the official prometheus client's defaultRegistry, those metrics will not be reported on tally since they do not share the common default registry

To Reproduce Is the issue reproducible?

Steps to reproduce the behavior: Just need to add a metric using https://github.com/prometheus/client_golang in the code and check the metrics endpoint. The metric registered with this client will be missing

Expected behavior All metrics registered anyhow using prometheus library should be reported on metrics endpoint even if it's tally which responds to metrics instead

Screenshots None :(

Additional context Solution would be to update the tally version to v4.1.0 https://github.com/uber-go/tally/blob/v4.1.0/prometheus/reporter.go#L30