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

EventListener loglevel would be more specific #1666

Open
chumaltd opened this issue Oct 26, 2023 · 1 comment
Open

EventListener loglevel would be more specific #1666

chumaltd opened this issue Oct 26, 2023 · 1 comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Comments

@chumaltd
Copy link

Expected Behavior

I'd like to have tkn eventlistener logs <eventlistener-name> less verbose, only related to something specific.

For the moment, changing loglevel can be ok, but does kubectl patch survives after every upgrading?
If not, solid defaults would be much appreciated.

Actual Behavior

I'm always getting debug-like logs at default info level.

Steps to Reproduce the Problem

I have multiple trigger set with simple CEL filter like following:

apiVersion: triggers.tekton.dev/v1beta1
kind: EventListener
spec:
  triggers:
  
  - name: trigger-a
    interceptors:
    - ref:
        name: cel
      params:
      - name: filter
        value: "header.match('X-Tekton-Trigger', 'trigger-a')"
    bindings:
    - ref: trigger-a-binding
    template:
      ref: trigger-a-template

  - name: trigger-b
    interceptors:
    - ref:
        name: cel
      params:
      - name: filter
        value: "header.match('X-Tekton-Trigger', 'trigger-b')"
    bindings:
    - ref: trigger-b-binding
    template:
      ref: trigger-b-template

This causes verbose CEL logs:

{"severity":"info","timestamp":"2023-10-26T02:47:01.396Z","logger":"eventlistener","caller":"sink/sink.go:420","message":"interceptor stopped trigger processing: rpc error: code = FailedPrecondition desc = expression header.match('X-Tekton-Trigger', 'trigger-b') did not return true","commit":"9498e02-dirty","eventlistener":"tekton","namespace":"tekton","/triggers-eventid":"cbe796a2-e75b-41bd-bf9a-dc415e1b6e6a","eventlistenerUID":"488e6bc4-b21f-4e08-9689-f64fdf419b26","/triggers-eventid":"cbe796a2-e75b-41bd-bf9a-dc415e1b6e6a","/trigger":"trigger-b"}

This example puts 1 log from 2 triggers, but actually I get (n-1) logs from n triggers on every request.
I think CEL no match logs would be debug level, as they have little info.

And another case, I got InvalidArgument with curl request, as curl sends form-encoded body by default:

{"severity":"info","timestamp":"2023-10-26T01:47:00.945Z","logger":"eventlistener","caller":"sink/sink.go:420","message":"interceptor stopped trigger processing: rpc error: code = InvalidArgument desc = form parameter encoding not supported, please change the hook to send JSON payloads","commit":"9498e02-dirty","eventlistener":"tekton","namespace":"tekton","/triggers-eventid":"ff6ba8d5-cde3-4807-88f4-979e15bc6deb","eventlistenerUID":"488e6bc4-b21f-4e08-9689-f64fdf419b26","/triggers-eventid":"ff6ba8d5-cde3-4807-88f4-979e15bc6deb","/trigger":"trigger-a"}

Actually this request completed successfully, so info level can be suitable.
But I think InvalidArgument would be higher log level, if they omit request body then cause different params from intended-JSON body.

Additional Info

Client version: 0.32.0
Pipeline version: v0.50.1
Triggers version: v0.25.0

@chumaltd chumaltd added the kind/bug Categorizes issue or PR as related to a bug. label Oct 26, 2023
@dibyom
Copy link
Member

dibyom commented Nov 15, 2023

I think changing the log levels for when an interceptor stops processing a trigger sounds reasonable

@dibyom dibyom added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. and removed kind/bug Categorizes issue or PR as related to a bug. labels Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

No branches or pull requests

2 participants