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

control-plane: access logs #166

Merged
merged 4 commits into from
Sep 10, 2019
Merged

control-plane: access logs #166

merged 4 commits into from
Sep 10, 2019

Conversation

jakubdyszkiewicz
Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz commented Sep 7, 2019

Access logs that shows traffic. Due to L4, we are very limited what we can display
Format for now

❯❯❯ cat access.log
[2019-09-07T07:32:04.323Z] 127.0.0.1:50897->127.0.0.1:11012 took 1ms, sent 333 bytes, received: 79 bytes
[2019-09-07T07:32:06.407Z] 127.0.0.1:50901->127.0.0.1:11012 took 1ms, sent 333 bytes, received: 79 bytes
[2019-09-07T07:32:07.191Z] 127.0.0.1:50904->127.0.0.1:11012 took 1ms, sent 333 bytes, received: 79 bytes
[2019-09-07T07:32:07.653Z] 127.0.0.1:50907->127.0.0.1:11012 took 1ms, sent 333 bytes, received: 79 bytes

refernce: https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log
Once we have outbound CDS, we can try %UPSTREAM_CLUSTER%

@jakubdyszkiewicz jakubdyszkiewicz force-pushed the feature/access-logs branch 2 times, most recently from 2c23e9a to a1b6082 Compare September 9, 2019 21:33
@@ -56,9 +56,14 @@ func printMeshes(meshes *mesh.MeshResourceList, out io.Writer) error {
}
mesh := meshes.Items[i]

accessLogs := table.OnOff(mesh.Spec.GetLogging().GetAccessLogs().GetEnabled())
if mesh.Spec.GetLogging().GetAccessLogs().GetEnabled() {
accessLogs += " (" + mesh.Spec.GetLogging().GetAccessLogs().FilePath + ")"
Copy link
Contributor

Choose a reason for hiding this comment

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

should be GetFilePath() for safety

@@ -46,7 +46,7 @@ func newGetMeshesCmd(pctx *getContext) *cobra.Command {

func printMeshes(meshes *mesh.MeshResourceList, out io.Writer) error {
data := printers.Table{
Headers: []string{"NAME", "MTLS"},
Headers: []string{"NAME", "MTLS", "DP ACCESS LOGS"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename it into ACCESS LOGS ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was ACCESS LOGS initially, but Marco wanted to add DP

@@ -118,6 +118,38 @@ var _ = Describe("Envoy", func() {
'@type': type.googleapis.com/envoy.config.filter.network.tcp_proxy.v2.TcpProxy
cluster: localhost:8080
statPrefix: localhost:8080
`,
}),
Entry("without transparent proxying", testCase{
Copy link
Contributor

Choose a reason for hiding this comment

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

test name could be more relevant

@@ -62,7 +62,9 @@ func DefaultDataplaneSyncTracker(rt core_runtime.Runtime, reconciler SnapshotRec
envoyCtx := xds_context.Context{
ControlPlane: envoyCpCtx,
Mesh: xds_context.MeshContext{
TlsEnabled: meshList.Items[0].Spec.Mtls.Enabled,
TlsEnabled: meshList.Items[0].Spec.GetMtls().Enabled,
Copy link
Contributor

Choose a reason for hiding this comment

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

should be GetEnabled() for safety

@jakubdyszkiewicz jakubdyszkiewicz merged commit 02e2198 into master Sep 10, 2019
@jakubdyszkiewicz jakubdyszkiewicz deleted the feature/access-logs branch September 10, 2019 09:49
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