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

Add metric for cluster.max_shards_per_node #277

Merged
merged 5 commits into from
Aug 16, 2019

Conversation

TheMeier
Copy link
Contributor

First draft, still need to do some testing. Also want to clean up and put the test json strings in separte fixture files.

fixes #271

Signed-off-by: Christoph Maser [email protected]

@zwopir
Copy link
Member

zwopir commented Aug 13, 2019

nice, thanks a lot! Looks good so far. Ping me if you want to merge

@TheMeier
Copy link
Contributor Author

So, turns out i forgot to encode the query params and the ?include_defaults=true was never send. This was a bug also for the existing shard allocation metric.

I also moved the test json content into files under a new fixtures directory. Probably we should consider a util package to make it easy to setup test strings from fixture files and then refactor the existing tests to use fixture files instead of inline json strings.

@zwopir BTW its quite easy to generate arbitrary test fixtures by simply firing up a container eg

docker run --rm -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.3.0

And then fetching the data, eg:

curl "http://localhost:9200/_cluster/settings?include_defaults=true" | jq .> fixtures/settings-7.3.0.json

@zwopir so i think this is ready to review :)

@TheMeier TheMeier changed the title WIP: Add metric for cluster.max_shards_per_node Add metric for cluster.max_shards_per_node Aug 13, 2019
Copy link
Member

@zwopir zwopir left a comment

Choose a reason for hiding this comment

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

looks good to me, except a little thing in opening the fixture files. Thanks a lot! The proposed change makes the fixture opening code so short that it doesn't make sense to exclude it to a utils package IMO.

collector/cluster_settings_test.go Outdated Show resolved Hide resolved
collector/cluster_settings_test.go Outdated Show resolved Hide resolved
@zwopir zwopir merged commit 856c781 into prometheus-community:master Aug 16, 2019
@zwopir
Copy link
Member

zwopir commented Aug 16, 2019

thank you!

@zwopir zwopir mentioned this pull request Aug 16, 2019
@tetianakravchenko
Copy link
Contributor

Any chance to get it released?

@KevW7
Copy link

KevW7 commented Oct 23, 2019

Hi, I'm really interested in this functionality - do you have any plans to create a new release?

@adrobisch adrobisch mentioned this pull request Dec 3, 2019
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.

Add metric for cluster.max_shards_per_node
4 participants