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

Feature structure logging #37

Merged
merged 3 commits into from
Jan 24, 2024
Merged

Feature structure logging #37

merged 3 commits into from
Jan 24, 2024

Conversation

heriet
Copy link
Member

@heriet heriet commented Jan 18, 2024

Summary

Review

  • All checks have passed
  • Check Result

Result

Log

loggingFormat json

    spec:
      containers:
      - args:
        - --endpoint=$(CSI_ENDPOINT)
        - --logging-format=json
        - --v=6
$ kubectl logs -n kube-system nifcloud-additional-storage-csi-controller-74474d54b-jbpfc
Defaulted container "controller" out of: controller, csi-provisioner, csi-attacher, csi-resizer, liveness-probe
{"ts":1705489197707.9517,"caller":"driver/driver.go:39","msg":"Driver:","v":0,"name":"additional-storage.csi.nifcloud.com","version":"v0.1.4-26-g54e449c-dirty"}
{"ts":1705489197708.2053,"caller":"mount/mount_linux.go:164","msg":"Detected OS without systemd","v":2}
{"ts":1705489197708.517,"caller":"driver/driver.go:91","msg":"Listening for connections","v":0,"address":"/var/lib/csi/sockets/pluginproxy/csi.sock"}
{"ts":1705489198083.2412,"caller":"driver/identity.go:45","msg":"Probe: called","v":6,"args":{}}
{"ts":1705489198085.636,"caller":"driver/identity.go:11","msg":"GetPluginInfo: called","v":6,"args":{}}
{"ts":1705489198087.0864,"caller":"driver/identity.go:21","msg":"GetPluginCapabilities: called","v":6,"args":{}}
{"ts":1705489198087.8186,"caller":"driver/controller.go:279","msg":"ControllerGetCapabilities: called","v":4," args":{}}
{"ts":1705489198275.8123,"caller":"driver/identity.go:45","msg":"Probe: called","v":6,"args":{}}
{"ts":1705489198277.6067,"caller":"driver/identity.go:11","msg":"GetPluginInfo: called","v":6,"args":{}}
{"ts":1705489198277.9875,"caller":"driver/identity.go:21","msg":"GetPluginCapabilities: called","v":6,"args":{}}
{"ts":1705489198278.456,"caller":"driver/controller.go:279","msg":"ControllerGetCapabilities: called","v":4," args":{}}
{"ts":1705489198486.3896,"caller":"driver/identity.go:45","msg":"Probe: called","v":6,"args":{}}
{"ts":1705489198497.865,"caller":"driver/identity.go:11","msg":"GetPluginInfo: called","v":6,"args":{}}
{"ts":1705489198498.737,"caller":"driver/identity.go:21","msg":"GetPluginCapabilities: called","v":6,"args":{}}
{"ts":1705489198499.5952,"caller":"driver/controller.go:279","msg":"ControllerGetCapabilities: called","v":4," args":{}}
{"ts":1705489198500.3894,"caller":"driver/controller.go:279","msg":"ControllerGetCapabilities: called","v":4," args":{}}
{"ts":1705489198878.3347,"caller":"driver/identity.go:11","msg":"GetPluginInfo: called","v":6,"args":{}}
{"ts":1705489215882.4473,"caller":"driver/identity.go:45","msg":"Probe: called","v":6,"args":{}}
{"ts":1705489225883.4373,"caller":"driver/identity.go:45","msg":"Probe: called","v":6,"args":{}}
{"ts":1705489235882.5593,"caller":"driver/identity.go:45","msg":"Probe: called","v":6,"args":{}}
{"ts":1705489245882.9575,"caller":"driver/identity.go:45","msg":"Probe: called","v":6,"args":{}}
{"ts":1705489252037.07,"caller":"driver/controller.go:53","msg":"CreateVolume: called","v":4,"args":{"name":"pvc-4f963b22-466d-46fd-b730-d461bc7d821e","capacity_range":{"required_bytes":10737412400},"volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4"}},"access_mode":{"mode":1}}],"parameters":{"type":"standard-flash-a"},"accessibility_requirements":{"requisite":[{"segments:{"topology.additional-storage.csi.nifcloud.com/zone":"east-12"}}],"preferred":[{"segments":{"topology.additional-storage.csi.nifcloud.com/zone":"east-12"}}]}}}
{"ts":1705489252659.8442,"caller":"driver/controller.go:115","msg":"Create volume","v":1,"zone":"east-12"}

empty loggingFormat

    spec:
      containers:
      - args:
        - --endpoint=$(CSI_ENDPOINT)
        - --v=6
$ kubectl logs -n kube-system nifcloud-additional-storage-csi-controller-66857495f6-dm7g2
Defaulted container "controller" out of: controller, csi-provisioner, csi-attacher, csi-resizer, liveness-probe
I0118 07:09:32.907776       1 driver.go:39] "Driver:" name="additional-storage.csi.nifcloud.com" version="v0.1.4-26-g54e449c-dirty"
I0118 07:09:32.907993       1 mount_linux.go:164] Detected OS without systemd
I0118 07:09:32.908300       1 driver.go:91] "Listening for connections" address="/var/lib/csi/sockets/pluginproxy/csi.sock"
I0118 07:09:33.380945       1 identity.go:45] "Probe: called" args={}
I0118 07:09:33.383206       1 identity.go:11] "GetPluginInfo: called" args={}
I0118 07:09:33.383698       1 identity.go:21] "GetPluginCapabilities: called" args={}
I0118 07:09:33.384396       1 controller.go:279] "ControllerGetCapabilities: called"  args={}
I0118 07:09:33.589253       1 identity.go:45] "Probe: called" args={}
I0118 07:09:33.591348       1 identity.go:11] "GetPluginInfo: called" args={}
I0118 07:09:33.592054       1 identity.go:21] "GetPluginCapabilities: called" args={}
I0118 07:09:33.592710       1 controller.go:279] "ControllerGetCapabilities: called"  args={}
I0118 07:09:33.976361       1 identity.go:45] "Probe: called" args={}
I0118 07:09:33.978919       1 identity.go:11] "GetPluginInfo: called" args={}
I0118 07:09:33.979608       1 identity.go:21] "GetPluginCapabilities: called" args={}
I0118 07:09:33.980103       1 controller.go:279] "ControllerGetCapabilities: called"  args={}
I0118 07:09:33.981192       1 controller.go:279] "ControllerGetCapabilities: called"  args={}
I0118 07:09:34.476333       1 identity.go:11] "GetPluginInfo: called" args={}
I0118 07:09:48.855082       1 controller.go:300] "ListVolumes: called" args={}
I0118 07:09:50.942646       1 identity.go:45] "Probe: called" args={}
I0118 07:10:00.942119       1 identity.go:45] "Probe: called" args={}
I0118 07:10:10.941365       1 identity.go:45] "Probe: called" args={}
I0118 07:10:20.942907       1 identity.go:45] "Probe: called" args={}
I0118 07:12:27.040953       1 controller.go:53] "CreateVolume: called" args={"name":"pvc-0cb55117-0e22-430f-91bf-ad81080c380b","capacity_range":{"required_bytes":107374182400},"volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4"}},"access_mode":{"mode":1}}],"parameters":{"type":"standard-flash-a"},"accessibility_requirements":{"requisite":[{"segments":{"topology.additional-storage.csi.nifcloud.com/zone":"east-12"}}],"preferred":[{"segments":{"topology.additional-storage.csi.nifcloud.com/zone":"east-12"}}]}}
I0118 07:12:27.637461       1 controller.go:115] "Create volume" zone="east-12"

Chart

loggingFormat json

$ helm template charts/nifcloud-additional-storage-csi-driver/ \
>     --set nifcloud.region=jp-east-1 \
>     --set nifcloud.accessKeyId.secretName=nifcloud-additional-storage-csi-secret \
>     --set nifcloud.accessKeyId.key=access_key_id \
>     --set nifcloud.secretAccessKey.secretName=nifcloud-additional-storage-csi-secret \
>     --set nifcloud.secretAccessKey.key=secret_access_key \
>     --set controller.loggingFormat=json \
>     --set node.loggingFormat=json \
>     | grep -A 6 -e "name: controller" -e "name: node-plugin"
        - name: node-plugin
          image: "ghcr.io/nifcloud/nifcloud-additional-storage-csi-driver:v0.1.0"
          imagePullPolicy: IfNotPresent
          args:
            - --endpoint=$(CSI_ENDPOINT)
            - --logging-format=json
            - --v=2
--
        - name: controller
          image: "ghcr.io/nifcloud/nifcloud-additional-storage-csi-driver:v0.1.0"
          imagePullPolicy: IfNotPresent
          args:
            - --endpoint=$(CSI_ENDPOINT)
            - --logging-format=json
            - --v=2

empty loggingFormat

$ helm template charts/nifcloud-additional-storage-csi-driver/ \
>     --set nifcloud.region=jp-east-1 \
>     --set nifcloud.accessKeyId.secretName=nifcloud-additional-storage-csi-secret \
>     --set nifcloud.accessKeyId.key=access_key_id \
>     --set nifcloud.secretAccessKey.secretName=nifcloud-additional-storage-csi-secret \
>     --set nifcloud.secretAccessKey.key=secret_access_key \
>     | grep -A 6 -e "name: controller" -e "name: node-plugin"
        - name: node-plugin
          image: "ghcr.io/nifcloud/nifcloud-additional-storage-csi-driver:v0.1.0"
          imagePullPolicy: IfNotPresent
          args:
            - --endpoint=$(CSI_ENDPOINT)
            - --logging-format=text
            - --v=2
--
        - name: controller
          image: "ghcr.io/nifcloud/nifcloud-additional-storage-csi-driver:v0.1.0"
          imagePullPolicy: IfNotPresent
          args:
            - --endpoint=$(CSI_ENDPOINT)
            - --logging-format=text
            - --v=2

@heriet heriet requested a review from aokumasan January 18, 2024 07:22
@aokumasan
Copy link
Member

Log output is now more flexible🚀

@aokumasan aokumasan merged commit 8eecb75 into main Jan 24, 2024
2 checks passed
@aokumasan aokumasan deleted the feature-structure-logging branch January 24, 2024 02:38
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.

2 participants