Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace gostats with tally #162

Merged
merged 6 commits into from
Jan 13, 2022
Merged

Conversation

nishkrishnan
Copy link
Contributor

Basically I create a Metrics object in valid.GlobalCfg which contains statsd info. This object should technically be parsed from yaml config and should eventually be used to support prometheus or any other metrics provider. (This will be done in a followup PR to not blow up the scope)

I also added runtime stats publishing to our executor service. This means that when we OSS this change, we'll need to move executor service out from the lyft package.

This is the first PR to get this out of the door and ensure our stats are working as expected.

server/server.go Outdated
statsScope := stats.NewDefaultStore().Scope(userConfig.StatsNamespace)
statsScope.Store().AddStatGenerator(stats.NewRuntimeStats(statsScope.Scope("go")))
// statsScope := stats.NewDefaultStore().Scope(userConfig.StatsNamespace)
// statsScope.Store().AddStatGenerator(stats.NewRuntimeStats(statsScope.Scope("go")))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete?

server/server.go Outdated Show resolved Hide resolved
tallystatsd "github.com/uber-go/tally/statsd"
)

func NewLoggingScope(logger logging.SimpleLogging, statsNamespace string) (tally.Scope, io.Closer, error) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to only be used by tests? Can you leave a comment about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll be used by the local server setup as well if it's running in debug mode.

Copy link

@msarvar msarvar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, couple comments.

}

func newReporter(cfg valid.Metrics, logger logging.SimpleLogging) (tally.StatsReporter, error) {
if cfg.Statsd == nil {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this always the case? What if there was a misconfigation that somehow set the statsd to nil? Shouldn't we return an error here? Looks like newLoggingReporter is only used by tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea is here is to have a set of fields in that config object for statsd, prometheus and really any time of metrics supported by tally.

We are checking to see which metrics object is populated and if nothing is, we just return the logging scope.

Nish Krishnan and others added 2 commits January 12, 2022 11:16
@nishkrishnan nishkrishnan merged commit 5cf9ccf into release-v0.17.3-lyft.1 Jan 13, 2022
@nishkrishnan nishkrishnan deleted the nish/update-to-tally branch January 13, 2022 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants