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

feat(kumacp) traffic logging matching #276

Merged
merged 2 commits into from
Sep 26, 2019

Conversation

jakubdyszkiewicz
Copy link
Contributor

First version of traffic logging

Summary

This is first version of traffic logging. It only supports file backend in mesh. The next step is to support sending it to ELK stack.

For the matching part. We match all inbounds and service on outbound and we place access log on outbound listener. For now, we apply all rules that match, we don't choose the most relevant one.

I did not reuse logic from TrafficPermission for now, because it's different. Here we match all inbound + outbound, in TrafficPermission we match destinations to inbounds.

Full changelog

  • Implement Traffic Log matching.

Issues resolved

#271

feat(kuma-cp) apply traffic logs
// To Match outbound, we need to match service tag of outbound and all tags of any inbound interface
func matchOutbound(outbound *mesh_proto.Dataplane_Networking_Outbound, inbounds []*mesh_proto.Dataplane_Networking_Inbound, logs []*mesh_core.TrafficLogResource) []*mesh_core.TrafficLogResource {
matchedLogs := []*mesh_core.TrafficLogResource{}
for _, perm := range logs {
Copy link
Contributor

Choose a reason for hiding this comment

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

why perm ?

}

type MatchedLogs struct {
Outbounds map[string][]*mesh_proto.LoggingBackend
Copy link
Contributor

Choose a reason for hiding this comment

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

as far as I understand, []*mesh_proto.LoggingBackend has no consistent order.

It might cause unnecessary Envoy configuration updates and flaky unit tests.

@jakubdyszkiewicz jakubdyszkiewicz merged commit ce06e69 into master Sep 26, 2019
@devadvocado devadvocado deleted the feature/traffic-logging-match branch January 6, 2020 09:51
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.

None yet

2 participants