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

unable to see Kubernetes pod logs in vmui #1772

Open
3 tasks
slopesaka opened this issue Nov 17, 2024 · 5 comments
Open
3 tasks

unable to see Kubernetes pod logs in vmui #1772

slopesaka opened this issue Nov 17, 2024 · 5 comments
Labels
question Further information is requested

Comments

@slopesaka
Copy link

slopesaka commented Nov 17, 2024

Is your question request related to a specific component?

Victoria-logs

Describe the question in detail

the documentation says to set vector.enabled to true to enable vector logs shipper but I see no logs in vmui when using this values.yaml file to install Victoria-logs-single using helm

vector:
  # -- Enable deployment of vector
  enabled: true
  role: Agent
  dataDir: /vector-data-dir
  resources: {}
  podMonitor:
    enabled: true
  containerPorts:
    - name: prom-exporter
      containerPort: 9090
      protocol: TCP
  service:
    enabled: false
  existingConfigMaps:
    - vl-config
  customConfig:
    data_dir: /vector-data-dir
    api:
      enabled: false
      address: 127.0.0.1:8686
      playground: true
    sources:
      k8s:
        type: kubernetes_logs
      internal_metrics:
        type: internal_metrics
    transforms:
      parser:
        type: remap
        inputs: [k8s]
        source: |
          .log = parse_json(.message) ?? .message
          del(.message)
    sinks:
      console:
        type: console
        inputs: [ parser ]
        encoding:
          codec: json

Troubleshooting docs

@slopesaka slopesaka added the question Further information is requested label Nov 17, 2024
@AndrewChubatiuk
Copy link
Collaborator

AndrewChubatiuk commented Nov 18, 2024

hey @slopesaka
could you please leave only custom chart values in a description?
what is your kubernetes version?
how do you setup it?
also migrating this issue to helm-charts

@AndrewChubatiuk AndrewChubatiuk transferred this issue from VictoriaMetrics/VictoriaMetrics Nov 18, 2024
@AndrewChubatiuk
Copy link
Collaborator

hey @slopesaka
do you still experience issues?

@trudzkimedo
Copy link

Hey.
Possibly related.

When used victoria-logs-single-0.8.1 / v0.41.0 with default config with vector set to enable on azure k8s, every json message that was generated by pod was not logged in but in it's place got:

missing _msg field; see https://docs.victoriametrics.com/victorialogs/keyconcepts/#message-field

It's same for today (victoria-logs-single-0.8.2 / v1.0.0) release.

this is easily to see when using istio ingress as it's logs are missing.

@trudzkimedo
Copy link

Quick update.
In my situation I misunderstood some concept here (especially that in fluent-bit it behaved bit differently)
My json message is parsed into log dict but since there was no message/msg/_msg field inside json payload default message (as above) is injected.
In fluent-bit the whole json payload was still left as _msg field.
Not sure if OP issue is same.

@AndrewChubatiuk
Copy link
Collaborator

hey @trudzkimedo
you can try to update processing pipeline to write a whole unparsed json into message field if neither msg nor message are found

vector:
  customConfig:
    transforms:
      parser:
        source: |
          message = parse_json(.message) ?? {}
          if is_nullish(message) || (is_null(message.msg) && is_null(message.message)) {
             message = .message
          }
          .log = message
          del(.message)

or add expected field names to VL-Msg-Field

vector:
  customConfig:
    sinks:
      vlogs:
        request:
          headers:
            VL-Msg-Field: message,msg,_msg,log.msg,log.message,log,<expected-value>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants