Skip to content

Conversation

@HiDAl
Copy link

@HiDAl HiDAl commented May 24, 2023

Add a new target (ingest) to the /_info API. It consolidates all the ingest information from the cluster nodes and returns a summary at the cluster level (compared with _nodes/stats/ingest it lacks the <node> dimension)

GET _info/ingest { "cluster_name": "runTask", "ingest": { "total": { "count": 77, "time_in_millis": 36, "current": 0, "failed": 0 }, "pipelines": { "test": { "count": 77, "time_in_millis": 4, "current": 0, "failed": 0, "processors": [ { "set": { "type": "set", "stats": { "count": 12, "time_in_millis": 0, "current": 0, "failed": 0 } } }, { "set": { "type": "set", "stats": { "count": 12, "time_in_millis": 0, "current": 0, "failed": 0 } } }, { "remove": { "type": "remove", "stats": { "count": 12, "time_in_millis": 0, "current": 0, "failed": 0 } } } ] }, ... } } } GET _info/_all { "cluster_name": "runTask", "http": { "current_open": 1, "total_opened": 112, "clients": [ { "id": 873375542, "local_address": "127.0.0.1:9200", "remote_address": "127.0.0.1:59560", "last_uri": "/_info/ingest", "opened_time_millis": 1684937431630, "closed_time_millis": 1684937431630, "last_request_time_millis": 1684937431630, "request_count": 1, "request_size_bytes": 0 }, { "id": 1090681032, "local_address": "127.0.0.1:9200", "remote_address": "127.0.0.1:59575", "last_uri": "/", "opened_time_millis": 1684937474976, "closed_time_millis": 1684937474976, "last_request_time_millis": 1684937474976, "request_count": 1, "request_size_bytes": 0 }, { "id": 2018590882, "local_address": "127.0.0.1:9200", "remote_address": "127.0.0.1:59576", "last_uri": "/_info/_all", "opened_time_millis": 1684937475181, "last_request_time_millis": 1684937475181, "request_count": 1, "request_size_bytes": 0 }, ... ] }, "ingest": { "total": { "count": 77, "time_in_millis": 36, "current": 0, "failed": 0 }, "pipelines": { "test": { "count": 77, "time_in_millis": 4, "current": 0, "failed": 0, "processors": [ { "set": { "type": "set", "stats": { "count": 12, "time_in_millis": 0, "current": 0, "failed": 0 } } }, { "set": { "type": "set", "stats": { "count": 12, "time_in_millis": 0, "current": 0, "failed": 0 } } }, { "remove": { "type": "remove", "stats": { "count": 12, "time_in_millis": 0, "current": 0, "failed": 0 } } } ] }, ... } } }

closes #95392

@HiDAl HiDAl added >enhancement :Data Management/Stats Statistics tracking and retrieval APIs Team:Data Management Meta label for data/management team v8.9.0 labels May 24, 2023
@github-actions
Copy link
Contributor

Documentation preview:

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine
Copy link
Collaborator

Hi @HiDAl, I've created a changelog YAML for you.

@HiDAl HiDAl requested review from dakrone and masseyke May 24, 2023 14:15
=======
`count`::
(integer)
Total number of documents ingested during the lifetime of the cluster.
Copy link
Member

Choose a reason for hiding this comment

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

Is it the lifetime of the cluster? Or the lifetimes of all the nodes that are currently in the cluster (i.e. a node loses these counts on restart right?)?

Copy link
Author

Choose a reason for hiding this comment

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

Right... Will see how to reword this... Anyway, this is going to be a really weird number, because it won't be all the time increasing with nodes restarting...
@dakrone This is an important point to consider for these statistics.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, this is tricky. Each node tracks the information it has seen since it started. This cluster-wide info view is the sum of those since-the-node-started statistics for all the nodes.

It's straightforward enough to talk about on this PR, but I'm not sure what I think would be appropriate wording for documentation. 😬

Copy link
Member

@masseyke masseyke left a comment

Choose a reason for hiding this comment

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

This looks pretty good to me. Tagging @joegallo in case he's currently working on something that would impact this.

GET /_info/ingest
# returns the http and ingest info of the cluster
GET /_info/ingest,ingest
Copy link
Member

Choose a reason for hiding this comment

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

I think you meant GET /_info/http,ingest

Copy link
Author

Choose a reason for hiding this comment

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

thanks!

Pablo Alcantar Morales added 3 commits May 24, 2023 22:40
rename pipeline & index to avoid collisions with other tests
@HiDAl HiDAl requested a review from masseyke May 25, 2023 14:33
@elasticsearchmachine
Copy link
Collaborator

Hi @HiDAl, I've updated the changelog YAML for you.

- is_true: ingest.total
- gte: { ingest.total.count: 2 }
- gte: { ingest.total.time_in_millis: 0 }
# next 2 conditions _should_ be 0, but because these yaml tests are sharing the same test cluster, other tests could
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nit, but the issue in this comment applies to all these gtes, not just the two below. Maybe reword and relocate?

@joegallo
Copy link
Contributor

Not a review, just a comment, but this new capability puts a song in my heart. 😄

@HiDAl
Copy link
Author

HiDAl commented May 25, 2023

@elasticsearchmachine run elasticsearch-ci/docs

@HiDAl HiDAl merged commit 244da06 into elastic:main May 26, 2023
@HiDAl HiDAl deleted the cluster-ingest-info branch May 26, 2023 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Stats Statistics tracking and retrieval APIs >enhancement Team:Data Management Meta label for data/management team v8.9.0

4 participants