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

Split the exporter into multiple collectors #65

Merged
merged 18 commits into from
Jun 28, 2017
Merged

Split the exporter into multiple collectors #65

merged 18 commits into from
Jun 28, 2017

Conversation

metalmatze
Copy link
Collaborator

@metalmatze metalmatze commented Jun 28, 2017

We want to get rid of the big maps with counters and gauges.
This is a approach I could come up with.

Put everything a metric needs (type, desc, value, labels) into a struct to have it in one place. The improvement is, that these metrics, now have value and label funcs to retrieve their values where they're declared. This way it's all combined at one place and not all over the place.

Changes to metrics:

- elasticsearch_up

We're doing multiple requests concurrently to the endpoint now. Not really sure on how this metric could be helpful now. Would need some sort of global shared state between collectors. Dropping it for now.

- elasticsearch_cluster_health_status_is_green
- elasticsearch_cluster_health_status_is_red
- elasticsearch_cluster_health_status_is_yellow

These are duplicates of elasticsearch_cluster_health_status which has the color as a label, as it should be.

- elasticsearch_filesystem_data_free_percent
- elasticsearch_filesystem_data_used_percent

Percentage has been computed in this exporter up until now. We're dropping these metrics. This should be calculated in prometheus itself. We're probably going to provide recording rules that make this optional metrics.

- elasticsearch_indices_flush_time_seconds_total
+ elasticsearch_indices_flush_time_seconds

Because we're talking about seconds.

- indices_search_fetch_time_seconds_total

This is a duplicate of indices_search_fetch_time_seconds

- elasticsearch_indices_search_query_time_seconds_total

This is a duplicate of indices_search_query_time_seconds

@metalmatze metalmatze requested a review from dominikschulz June 28, 2017 12:30
Copy link
Contributor

@dominikschulz dominikschulz left a comment

Choose a reason for hiding this comment

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

LGTM

Would be nice to add a proper README, example recording/alerting rules and a example Grafana dashboard, but we can merge first and add that later.

),
NumberOfPendingTasks: prometheus.NewDesc(
prometheus.BuildFQName(namespace, subsystem, "number_of_pending_tasks"),
"XXX WHAT DOES THIS MEAN?",
Copy link
Contributor

Choose a reason for hiding this comment

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

Intended or left over? If we can't figure out a proper description we may want to put an undocumented instead.

),
DelayedUnassignedShards: prometheus.NewDesc(
prometheus.BuildFQName(namespace, subsystem, "delayed_unassigned_shards"),
"XXX WHAT DOES THIS MEAN?",
Copy link
Contributor

Choose a reason for hiding this comment

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

document, please

),
TimedOut: prometheus.NewDesc(
prometheus.BuildFQName(namespace, subsystem, "timed_out"),
"XXX WHAT DOES THIS MEAN?",
Copy link
Contributor

Choose a reason for hiding this comment

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

document, please

)

var statusValue float64
if clusterHealthResponse.Status == "green" {
Copy link
Contributor

Choose a reason for hiding this comment

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

What about red and yellow? Would like to be able to distinquish between those two as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I currently assume that elasticsearch_cluster_health_status is 0 if red or yellow and only 1 when green.
I can only think about doing something like

  • red => 0
  • yellow => 1
  • green => 2
    which honestly feels weird.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, indeed. I see that issue. But on the other hand I'd like to differentiate between red and yellow ...

"The number of shards that are currently moving from one node to another node.",
[]string{"cluster"}, nil,
),
StatusIsGreen: prometheus.NewDesc(
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we drop this, please?
We already have the status metric below.

NumberOfNodes *prometheus.Desc
NumberOfPendingTasks *prometheus.Desc
RelocatingShards *prometheus.Desc
StatusIsGreen *prometheus.Desc
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we drop this in favor of Status?

RelocatingShards *prometheus.Desc
StatusIsGreen *prometheus.Desc
Status *prometheus.Desc
StatusIsYellow *prometheus.Desc
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we drop this in favor of Status?

StatusIsGreen *prometheus.Desc
Status *prometheus.Desc
StatusIsYellow *prometheus.Desc
StatusIsRed *prometheus.Desc
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we drop this in favor of Status?

@dominikschulz dominikschulz merged commit d37917b into master Jun 28, 2017
@dominikschulz dominikschulz deleted the v2 branch June 28, 2017 15:01
aveyrenc added a commit to orange-cloudfoundry/prometheus-boshrelease that referenced this pull request Sep 20, 2017
Since prometheus-community/elasticsearch_exporter#65 the elasticsearch_up metric is in the elasticsearch_cluster_health namespace
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