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

fluentd-gcp 2.0.5 doesn't work with json output to stdout #48108

Closed
maisem opened this issue Jun 26, 2017 · 4 comments
Closed

fluentd-gcp 2.0.5 doesn't work with json output to stdout #48108

maisem opened this issue Jun 26, 2017 · 4 comments
Assignees
Labels
area/logging sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation.

Comments

@maisem
Copy link

maisem commented Jun 26, 2017

1.6.6 shifted the fluentd-gcp image from 2.0.2 to 2.0.5. This seems to have broken the json detection from stdout. Using 2.0.2 the logs are parsed into jsonPayload, however for 2.0.5 they are passed into textPayload.

Reproduction steps:

  1. Create a GKE cluster with master version 1.6.4
  2. Deploy a dummy pod to echo some JSON to stdout:
 apiVersion: v1
    kind: Pod
    metadata:
      name: blabbermouth
    spec:
      containers:
      - name: busybox
        image: gcr.io/google-containers/busybox
        command: ['sh', '-c', 'while :; do echo "{\"severity\": \"INFO\", \"message\": \"test\"}"; sleep 5; done']
  1. Lookup container logs in StackDriver: resource.type="container" and resource.labels.container_name="busybox"
  2. Observe that jsonPayload field of each logEntry is populated with the app's output JSON
  3. Upgrade the GKE master to 1.6.6.
  4. Observe that the log query in 4 now shows each logEntry with the output in a textPayload.

cc: @jlowdermilk @crassirostris @piosz

@k8s-github-robot
Copy link

@maisem There are no sig labels on this issue. Please add a sig label by:
(1) mentioning a sig: @kubernetes/sig-<team-name>-misc
e.g., @kubernetes/sig-api-machinery-misc for API Machinery
(2) specifying the label manually: /sig <label>
e.g., /sig scalability for sig/scalability

Note: method (1) will trigger a notification to the team. You can find the team list here and label list here

@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jun 26, 2017
@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jun 26, 2017
@k8s-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jun 26, 2017
@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jun 26, 2017
@k8s-github-robot
Copy link

@maisem There are no sig labels on this issue. Please add a sig label by:
(1) mentioning a sig: @kubernetes/sig-<team-name>-misc
e.g., @kubernetes/sig-api-machinery-misc for API Machinery
(2) specifying the label manually: /sig <label>
e.g., /sig scalability for sig/scalability

Note: method (1) will trigger a notification to the team. You can find the team list here and label list here

@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jun 26, 2017
@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jun 26, 2017
@k8s-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jun 26, 2017
@j3ffml j3ffml added sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. and removed sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Jun 27, 2017
@crassirostris
Copy link

@maisem Thanks! That is indeed a bug with the new version. I'll patch it in the repo shortly

@crassirostris
Copy link

Nope, not a bug with the new version, it was actually introduced with #45734

Because of the first clause in https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud/blob/master/lib/fluent/plugin/out_google_cloud.rb#L569 additional field in the record breaks JSON logging

k8s-github-robot pushed a commit that referenced this issue Jun 27, 2017
Automatic merge from submit-queue (batch tested with PRs 48139, 48042, 47645, 48054, 48003)

Fix fluentd-gcp configuration to facilitate JSON parsing

There's a bug in #45734, because of which each records gets additional field and google-cloud plugin thinks it's not JSON (https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud/blob/master/lib/fluent/plugin/out_google_cloud.rb#L569)

Fixes #48108

/cc @piosz @fgrzadkowski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation.
Projects
None yet
Development

No branches or pull requests

5 participants