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

没有sink 任何东西 #255

Open
631068264 opened this issue Dec 15, 2022 · 3 comments
Open

没有sink 任何东西 #255

631068264 opened this issue Dec 15, 2022 · 3 comments

Comments

@631068264
Copy link

写了个demo 想看结构体到底长什么样

log Exporting 好几个事件

I1215 17:57:27.796533       1 eventer.go:67] /kube-eventer --source=kubernetes:https://kubernetes.default --sink=webhook:http://event-receive-example-nodeport:9012/api/event?level=Normal,Warning&header=contentType1=customContentType&header=customHeaderKey=customHeaderValue1
I1215 17:57:27.796595       1 eventer.go:68] kube-eventer version: v1.2.0 commit: 484d9cd
I1215 17:57:27.799242       1 eventer.go:94] Starting with webHook sink
I1215 17:57:27.799293       1 eventer.go:108] Starting eventer
I1215 17:57:27.799531       1 eventer.go:116] Starting eventer http service
I1215 17:57:30.000219       1 manager.go:102] Exporting 3 events
I1215 17:58:00.000241       1 manager.go:102] Exporting 4 events
I1215 17:58:30.000188       1 manager.go:102] Exporting 1 events
I1215 17:59:00.000203       1 manager.go:102] Exporting 0 events
I1215 17:59:30.000469       1 manager.go:102] Exporting 2 events
I1215 18:00:00.000189       1 manager.go:102] Exporting 10 events
I1215 18:00:30.000201       1 manager.go:102] Exporting 2 events
I1215 18:01:00.000200       1 manager.go:102] Exporting 2 events
I1215 18:01:30.000190       1 manager.go:102] Exporting 3 events
I1215 18:02:00.000188       1 manager.go:102] Exporting 2 events
I1215 18:02:30.000196       1 manager.go:102] Exporting 4 events

api那边什么都没收到 测试过接收端没问题

INFO:     Started server process [1]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:9012 (Press CTRL+C to quit)
{
    "aks":["tst","test","test1"]
}
PostmanRuntime/7.29.2
INFO:     10.42.0.1:16778 - "GET /api/event HTTP/1.1" 200 OK

@app.get("/api/event")
async def example(request: Request, user_agent: Union[str, None] = Header(default=None)):
    res = await request.body()
    logger.info(res.decode())

    logger.info(user_agent)
    return {"User-Agent": user_agent}
@631068264
Copy link
Author

--sink=webhook:http://event-receive-example-nodeport:9012/api/event?header=contentType1=customContentType&header=customHeaderKey=customHeaderValue1

把sink改成这样就可以了 文档对level的描述有问题啊

但是得到的内容时间都是不对的

image

都是0001-01-01 00:00:00 +0000 UTC

@631068264
Copy link
Author

而且怎么做到返回全部字段而不是缺省的?

@ringtail
Copy link
Member

@631068264 可以配置configmap

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

No branches or pull requests

2 participants