Вопрос

I build a web analytics tool and consider to use Graphite. This is a very basic tool with just a few interesting dimentions but there are multiple dimensions associated with a measurement. For example when a user hits the site I want to keep track of geography, browser etc. The metric name would probably be:

usa.chrome.windows8.organic...

I can then use wildcards to do interesting queries.

Is this abuse of metric names (and Graphite in general), or is it a good approach as long as I only care about a small amount of metrics.

Это было полезно?

Решение

I think the approach will be fine, although there are some important considerations when naming the metrics. Because Graphite will store a .wsp file for every metric name you'll have a difficult time re-sizing or adjusting the storage settings should you decide to change your configuration. Additionally, the Graphite UI will have a "folder" for every metric name so you can easily make the UI unusable.

Graphite recommends that "Volatile path components should be kept as deep into the hierarchy as possible". This essentially means that if you can push the parts of the metrics that are frequently unique to the end of the "bucket" without impacting your grouping queries you should try to do so.

Here is a great post on using Graphite that includes naming recommendations. And here is another one with additional info from Jason Dixon (an excellent source for Graphite stuff in general).

Другие советы

This is basically a forwarded answer of mine from another question...

I did encounter a nice guide (also referenced in the accepted answer) someone put together on this topic though. From the guide:

<namespace>.<instrumented section>.<target (noun)>.<action (past tense verb)>

Example:

accounts.authentication.password.attempted

You've already considered the needs you will have, but try and foresee a bit and not restrict yourself from expanding your capabilities. Unless you have totals at every level, it will be difficult/tedious for you to compare metrics. Perhaps consider some metrics that you typically would like to compare and start by separating those out.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top