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

[8.x](backport #41289) Only watch metadata for ReplicaSets in metricbeat k8s module #41323

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 18, 2024

Proposed commit message

Use metadata watchers for ReplicaSets in the metricbeats Kubernetes module. This is a similar change to #41100, with two major differences:

  • State metrics for ReplicaSets may actually need all the metadata, so our transform function keeps it.
  • Due to the way the update handler function switches over the resource type, our resource needs to have TypeMeta present. The informer doesn't set this, so we need to do it ourselves.

A decent chunk of the changes is just passing around a metadata-only k8s client.

For more details see elastic/elastic-agent#5623.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

You need a full K8s cluster, unfortunately. I've tested it using the default elastic-agent standalone manifest, by building a custom container image and loading it into a local kind cluster.

Related issues


This is an automatic backport of pull request #41289 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner October 18, 2024 15:21
@mergify mergify bot added the backport label Oct 18, 2024
@mergify mergify bot requested review from gizas and constanca-m and removed request for a team October 18, 2024 15:21
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 18, 2024
@botelastic
Copy link

botelastic bot commented Oct 18, 2024

This pull request doesn't have a Team:<team> label.

Copy link
Contributor Author

mergify bot commented Oct 21, 2024

This pull request has not been merged yet. Could you please review and merge it @swiatekm? 🙏

@swiatekm swiatekm merged commit b3abb30 into 8.x Oct 21, 2024
38 checks passed
@swiatekm swiatekm deleted the mergify/bp/8.x/pr-41289 branch October 21, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant