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

fix(*) traffic logging to tcp backends #1394

Merged
merged 3 commits into from
Jan 7, 2021
Merged

Conversation

nickolaev
Copy link
Contributor

@nickolaev nickolaev commented Jan 7, 2021

Summary

#894 actually broke TrafficLogs with TCP logger. It actually created a discrepancy in the naming of the UNIX socket between kuma-dp and the bootstrap generator in kuma-cp. In effect, Envoy was not able to find the GRPC logging service as provided by kuma-dp and the logs are never sent to the TCP logger.

Revert it and shorten the UNIX socket name by removing the not needed prefix kuma-access-logs-.

Issues resolved

Fix #853 (again)

Documentation

  • Not needed

Nikolay Nikolaev added 2 commits January 7, 2021 16:31
This reverts commit 2bec835.

# Conflicts:
#	app/kuma-dp/pkg/dataplane/accesslogs/server.go

Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
@nickolaev nickolaev requested a review from a team as a code owner January 7, 2021 14:51
@@ -183,7 +183,7 @@ func (b *bootstrapGenerator) generateFor(proxyId core_xds.ProxyId, dataplane *co
}
certBytes = base64.StdEncoding.EncodeToString(cert)
}
accessLogPipe := fmt.Sprintf("/tmp/kuma-access-logs-%s-%s.sock", request.Name, request.Mesh)
accessLogPipe := fmt.Sprintf("/tmp/%s-%s.sock", request.Name, request.Mesh)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's better to create a function like:

func AccessLogPipeName(name, mesh string) string {
    return fmt.Sprintf("/tmp/%s-%s.sock", name, mesh)
}

and use it from both places? That'd allow avoiding bugs like this one, what do you think?

@jakubdyszkiewicz
Copy link
Contributor

IMHO this does not solve the initial problem.

The problem was that if the name has more than 108 characters, it will fail. Even with getting rid of the kuma-access-logs- we can still easily hit the limit because the name can have up to 253 chars https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#:~:text=This%20means%20the%20name%20must,no%20more%20than%20253%20characters

On top of that, I think it makes sense to mark this file that it is kuma access log socket, otherwise someone can just delete it.
My suggestion is to construct this kuma-al-{name}-{mesh} and trim this to 100 characters.

Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
@nickolaev nickolaev changed the title Fix/traffic log unix socket fix(*) traffic logging to tcp backends Jan 7, 2021
@nickolaev nickolaev merged commit 950448d into master Jan 7, 2021
@nickolaev nickolaev deleted the fix/traffic_log_unix_socket branch January 7, 2021 17:05
mergify bot pushed a commit that referenced this pull request Jan 7, 2021
* Revert "fix(kuma-dp): reduce size of access log address (#894)"

This reverts commit 2bec835.

* chore(*) shorten the unix socket name

Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
(cherry picked from commit 950448d)
nickolaev pushed a commit that referenced this pull request Jan 7, 2021
* Revert "fix(kuma-dp): reduce size of access log address (#894)"

This reverts commit 2bec835.

* chore(*) shorten the unix socket name

Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
(cherry picked from commit 950448d)

Co-authored-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
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.

Kuma-sidecar not starting when using Telepresence
3 participants