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 get and update meta methods to ESIndex #1896

Closed
wants to merge 2 commits into from

Conversation

wangch079
Copy link
Member

Part of https://github.com/elastic/enterprise-search-team/issues/6169

This PR adds a method meta (get meta of an index) and update_meta (update meta of an index) to ESIndex.

The two new methods will be used in the subsequent PRs, where telemetry_last_sent will be stored in the meta of .elastic-connectors.

Checklists

Pre-Review Checklist

  • this PR has a meaningful title
  • this PR links to all relevant github issues that it fixes or partially addresses
  • this PR has a thorough description
  • Covered the changes with automated tests
  • Tested the changes locally
  • Added a label for each target release version (example: v7.13.2, v7.14.0, v8.0.0)

@wangch079 wangch079 force-pushed the chenhui/telemetry-last-sent branch from ae7e76e to 86346e5 Compare November 14, 2023 17:34
Comment on lines +131 to +135
async def meta(self):
response = await self.client.indices.get_mapping(index=self.index_name)
# Assume index name is the same pattern and the latest index is always the one with the largest suffix
latest_index = max(response.keys())
return response[latest_index].get("mappings", {}).get("_meta")
Copy link
Member

Choose a reason for hiding this comment

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

I vaguely remember, that calls to get_mappings are very expensive on loaded clusters.

How often do we intend to do the calls?

Copy link
Member Author

Choose a reason for hiding this comment

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

About every one hour (by the default interval)

I vaguely remember, that calls to get_mappings are very expensive on loaded clusters.

This is new to me, 🤔 get_mappings will only try to get the mappings of the index, not the docs.

Copy link
Member

Choose a reason for hiding this comment

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

get_mappings will only try to get the mappings of the index, not the docs.

True, but afaik it's one of operations that are "stop the world" and block other operations running on this index (or cluster?).

I just highlight it as something to double check with Elasticsearch team

@wangch079
Copy link
Member Author

Close the PR as we will move telemetry data collection to Kibana

@wangch079 wangch079 closed this Nov 27, 2023
@wangch079 wangch079 deleted the chenhui/telemetry-last-sent branch November 27, 2023 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants