Skip to content

Conversation

@jamtur01
Copy link
Contributor

@jamtur01 jamtur01 commented Dec 3, 2017

Emphasis on clarity, consistency, and tone.

@jamtur01
Copy link
Contributor Author

jamtur01 commented Dec 3, 2017

Also, where do folks stand with regard to the Oxford comma?

Copy link
Contributor

@matthiasr matthiasr left a comment

Choose a reason for hiding this comment

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

Added some comments. I'm not happy about the uneven line lengths now – I'd prefer to stay in line with how the document already is. We can un-break lines separately.

I'm not passionate about the oxford comma but found it causes less bike shedding to just add it everywhere.

continuously with new versions, if you try to get things perfect then you’ve
signed yourself up for a lot of ongoing work. The [mysql
exporter](https://github.com/prometheus/mysqld_exporter) is on this end of the
If, on the other hand, the system has hundreds of metrics that change
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rephrase this a little more to get rid of the double if, like:

On the other hand, if you try to get things perfect when the system has hundreds of metrics that change frequently with new versions, then you’ve signed yourself up for a lot of ongoing work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - thanks much nicer.

may be too granular and expensive on large setups (e.g. the haproxy exporter
allows filtering of per-server stats). Similarly there may be expensive metrics
that are disabled by default.
may be too granular and expensive on large setups, for example the [HAProxy exporter](https://github.com/prometheus/haproxy_exporter) allows filtering of per-server stats. Similarly there may be expensive metrics that are disabled by default.
Copy link
Contributor

Choose a reason for hiding this comment

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

The line breaks are very inconsistent now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to fix the whole file.

slaves you wanted to run some business queries against the data to then export.
Having an exporter that uses your usual load balancing approach to talk to one
slave is the sanest approach.
The second exception is where you’re pulling some stats out of a random instance of a system and don’t care which one you’re talking to. Consider a set of MySQL slaves you wanted to run some business queries against the data to then export. Having an exporter that uses your usual load balancing approach to talk to one slave is the sanest approach.
Copy link
Contributor

Choose a reason for hiding this comment

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

While we're at it, WDYT about fixing slavery metaphors here? I think "replica" is a perfectly self-explanatory alternative.

Copy link
Contributor Author

@jamtur01 jamtur01 Dec 4, 2017

Choose a reason for hiding this comment

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

Awesome - wasn't sure - some projects are receptive to this - others it's a 500 comment storm. Will fix. I already fixed the Mesos one but the MySQL is much more ... sticky.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case replica is actually more accurate.

Firstly, when do you expire metrics? Collected and things talking to Graphite
both export regularly, and when they stop we want to stop exposing the metrics.
Collected includes an expiry time so we use that, Graphite doesn’t so it’s a
Collected includes an expiry time so we use that, Graphite doesn’t so it is a
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be Collectd?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Fixed.


The seconds is to have an `myexporter_up` (e.g. `haproxy_up`) variable that’s
0/1 depending on whether the scrape worked.
The seconds is to have an `myexporter_up`, e.g. `haproxy_up`, variable that has a value of 0 or 1 depending on whether the scrape worked.
Copy link
Contributor

Choose a reason for hiding this comment

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

second


Metrics must use base units (e.g. seconds, bytes) and leave converting them to
something more readable to the graphing software. No matter what units you end
something more readable to upstream tools. No matter what units you end
Copy link
Contributor

Choose a reason for hiding this comment

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

I meant graphing software, this is a frontend concern.


Metric names should not include the labels that they’re exported with (e.g.
`by_type`) as that won’t make sense if the label is aggregated away.
Metric names should not include the labels that they’re exported with, e.g.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is as clear

so sometimes it’s best to leave them as-is.

Exposed metrics should not contain colons, these are for users to use when
Exposed metrics should not contain colons, these are reserved for use when
Copy link
Contributor

Choose a reason for hiding this comment

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

It needs to be clear that these are for end-user use. "aggregating" has a few different meanings depending on who you're talking to.

way to expose this is as one metric for total requests and another metric for
failed requests. This makes it easy to calculate the failure ratio. Do not use
one metric with a failed/success label. Similarly with hit/miss for caches,
one metric with a failed or success label. Similarly with hit/miss for caches,
Copy link
Contributor

Choose a reason for hiding this comment

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

Be consistent between 'or' and '/'

automatically processing a set of metrics), use `UNTYPED` in that case. In
general `UNTYPED` is a safe default.
Often it won’t be obvious what the type of metric is, especially if
you’re automatically processing a set of metrics, use `UNTYPED` in that
Copy link
Contributor

Choose a reason for hiding this comment

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

I think end the sentence at "metrics" might be a little clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. It's a bit repetitive.

[StatsD](https://github.com/prometheus/statsd_exporter) exporters also
requiring configuration to extract labels.

Providing a configuration that produces some output automatically and a
Copy link
Contributor

Choose a reason for hiding this comment

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

If configuration is provided then it's not automatic


Providing a configuration that produces some output automatically and a
selection of example configurations for transformation, if required, is
advised. Here are some guidelines for writing or adapting custom
Copy link
Contributor

Choose a reason for hiding this comment

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

Last sentence here doesn't fit.

within a metrics should (almost) always have the same unit (consider if fan
speeds were mixed in with the voltages, and you had no way to automatically
separate them).
Read or write and send or receive are best as separate metrics, rather than as
Copy link
Contributor

Choose a reason for hiding this comment

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

Read and write is a set here, so 'or' doesn't make sense.

latter breaks sum and is quite difficult to work with. Some client
libraries, for example Go, will actively try to stop you doing the
latter in a custom collector, and all client libraries should stop you
from doing the former with direct instrumentation. Never do either of
Copy link
Contributor

Choose a reason for hiding this comment

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

s/former/latter/

Copy link
Contributor

@brian-brazil brian-brazil left a comment

Choose a reason for hiding this comment

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

Almost there.

libraries, for example Go, will actively try to stop you doing the
latter in a custom collector, and all client libraries should stop you
from doing the former with direct instrumentation. Never do either of
former in a custom collector, and all client libraries should stop you
Copy link
Contributor

Choose a reason for hiding this comment

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

They both should be "latter". There's no way we can really stop the former.

YAML is the standard Prometheus configuration format, all configuration
should use YAML by default.

Here are some guidelines for writing or adapting custom exporters.
Copy link
Contributor

Choose a reason for hiding this comment

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

This sentence should be removed, this is not an overview section.

@brian-brazil brian-brazil merged commit 01d2816 into prometheus:master Dec 6, 2017
@brian-brazil
Copy link
Contributor

Thanks!

aylei pushed a commit to aylei/docs that referenced this pull request Oct 28, 2019
Signed-off-by: rleungx <rleungx@gmail.com>
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.

3 participants