Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

What's the difference between stats and metrics? #253

Open
raulk opened this issue Mar 27, 2019 · 5 comments
Open

What's the difference between stats and metrics? #253

raulk opened this issue Mar 27, 2019 · 5 comments

Comments

@raulk
Copy link

raulk commented Mar 27, 2019

This duality is very confusing. It seems like two parallel worlds in opencensus-go.
Isn't a "gauge" a measure with a view with last value aggregation?
Are you planning to unify "stats" and "metrics" somehow?

@songy23
Copy link
Contributor

songy23 commented Mar 27, 2019

Yes, @mayurkale22 will add documentation on the difference between stats and metrics soon. Tracking in #244.

@raulk
Copy link
Author

raulk commented Mar 27, 2019

Is there a chance you can give us the lowdown and reasoning behind this while proper documentation is sorted?

We're evaluating OC vs direct Prometheus usage, and are finding it hard to follow the design decisions being made here.

Thanks!

@songy23
Copy link
Contributor

songy23 commented Mar 28, 2019

In general, Stats APIs are the "OpenCensus" way of generating metrics. By using Stats APIs OpenCensus provides a way to record, aggregate and break down stats. After aggregation, Stats APIs produce Metrics.

Metrics APIs are for exporting and consuming aggregated metrics. Stats API is one source of Metric. There can be other sources, like Gauge, Dropwizard metrics, etc.

@raulk
Copy link
Author

raulk commented Mar 28, 2019

So if I read correctly, metrics are a way to circumvent the Stats/View division and generate metrics straight through, like Prometheus does?

@songy23
Copy link
Contributor

songy23 commented Mar 28, 2019

metrics are a way to circumvent the Stats/View division and generate metrics straight through, like Prometheus does?

That's correct, it's similar to exporting aggregated metrics in Prometheus (https://prometheus.io/docs/instrumenting/writing_exporters/). With metrics API we're providing a way to export metrics to OpenCensus.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants