generated from honeycombio/.github
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add service k8s metadata to events (#257)
## Which problem is this PR solving? Kubernetes services are commonly used as load balancers between pod deployments so the pods can be managed separately from routing traffic to live pods. However, the agent only appends Kubernetes metadata when the source and destination IPs of generated events are pods. This PR updates the process that applies Kubernetes metadata to also lookup services using the source and destination IPs. - Closes #251 ## Short description of the changes - Update the k8sCachedClient to index services in the serviceInformer by it's registered cluster IP - ClusterIP will be assigned when using services with a type of ClusterIP, NodePort and LoadBalancer - Update k8sutils to attempt to lookup a service if pod lookup failed and if a match is found, apply common service attributes - Extend both pod and service metadata to include a new "k8s.resource.type" attribute (will be set to either "pod" or "service") - Move custom k8s attribute keys to consts - Update existing libhoney handler test to verify the new resource type attribute is set - Add new test where the destination IP of an httpEvent targets a service and verify the expected attributes are set ## How to verify that this has the expected result Events generated by the agent now include a resource type attribute and apply service metadata when the service is routed through a service resource and not just pods.
- Loading branch information
1 parent
1fa24dd
commit 0dfe201
Showing
3 changed files
with
152 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters