Skip to content

add diskstats on Darwin#593

Merged
discordianfish merged 8 commits intoprometheus:masterfrom
lufia:feature/diskstat_darwin
Jul 6, 2017
Merged

add diskstats on Darwin#593
discordianfish merged 8 commits intoprometheus:masterfrom
lufia:feature/diskstat_darwin

Conversation

@lufia
Copy link
Copy Markdown
Contributor

@lufia lufia commented Jun 3, 2017

I have implemented a part of diskstats metrics.

  • reads_completed
  • sectors_read
  • read_time_ms
  • writes_completed
  • sectors_written
  • write_time_ms
  • bytes_read
  • bytes_written

but below metrics are not implemented.

  • reads_merged
  • writes_merged
  • io_now
  • io_time_ms
  • io_time_weighted

@grobie grobie requested a review from discordianfish June 6, 2017 09:12
{
typedDesc: typedDesc{
desc: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, diskSubsystem, "read_time_ms"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These metric names don't follow our best practices (base unit for time is seconds, counters should end on _total). I guess we need to decide whether we want to stay consistent with the current linux implementation, or avoid a breaking change for darwin users along the road. Eventually, we'll rename the linux metrics in a big breaking release.

I think I'd use better names here already.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed with @grobie, all new metrics should follow the best practices (unless maybe all the exporter is doing is surfacing existing metrics name).

Copy link
Copy Markdown
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me in general, but the metrics names need changing.

{
typedDesc: typedDesc{
desc: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, diskSubsystem, "read_time_ms"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed with @grobie, all new metrics should follow the best practices (unless maybe all the exporter is doing is surfacing existing metrics name).

@lufia
Copy link
Copy Markdown
Contributor Author

lufia commented Jun 8, 2017

I have renamed metrics to fit guideline

Copy link
Copy Markdown
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

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

Great, LGTM!

@SuperQ
Copy link
Copy Markdown
Member

SuperQ commented Jun 8, 2017

I don't see an update to the vendor.json. You need to use the govendor utility to create the vendoring.

@discordianfish
Copy link
Copy Markdown
Member

Hrmm but why did the build pass then?

@SuperQ
Copy link
Copy Markdown
Member

SuperQ commented Jun 8, 2017

go build doesn't care about the json file.

@discordianfish
Copy link
Copy Markdown
Member

I thought we make it never fetch but not sure where I got that from..

@lufia
Copy link
Copy Markdown
Contributor Author

lufia commented Jun 9, 2017

sorry, since I hadn't found vendor.json until today,
I put iostat package manually in vendor directory.
I'm going to fix vendor.json.

@grobie
Copy link
Copy Markdown
Member

grobie commented Jun 9, 2017 via email

@lufia
Copy link
Copy Markdown
Contributor Author

lufia commented Jun 9, 2017

vendor.json is updated.

@grobie thank you for your mention.

Copy link
Copy Markdown
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

LGTM

@lufia
Copy link
Copy Markdown
Contributor Author

lufia commented Jul 3, 2017

@grobie What would this PR require next action?

Copy link
Copy Markdown
Member

@grobie grobie left a comment

Choose a reason for hiding this comment

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

One last comment, looks good otherwise.

README.md Outdated
conntrack | Shows conntrack statistics (does nothing if no `/proc/sys/net/netfilter/` present). | Linux
cpu | Exposes CPU statistics | Darwin, Dragonfly, FreeBSD, Linux
diskstats | Exposes disk I/O statistics from `/proc/diskstats`. | Linux
diskstats | Exposes disk I/O statistics from `/proc/diskstats`. | Darwin, Linux
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That description is not longer correct, Darwin doesn't have a proc filesystem. Either drop it or describe each source.

@discordianfish
Copy link
Copy Markdown
Member

Awesome, thanks a lot for you contribution! 🎆

@discordianfish discordianfish merged commit a077024 into prometheus:master Jul 6, 2017
@lufia lufia deleted the feature/diskstat_darwin branch September 13, 2017 06:32
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* Add diskstats collector for Darwin

* Update year in the header

* Update README.md

* Add github.com/lufia/iostat to vendored packages

* Change stats to follow naming guidelines

* Add a entry of github.com/lufia/iostat into vendor.json

* Remove /proc/diskstats from description
tamcore pushed a commit to gitgrave/node_exporter that referenced this pull request Oct 22, 2024
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.13.0 to 0.15.0.
- [Commits](golang/sys@v0.13.0...v0.15.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.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.

4 participants