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

消费日志中记录使用的上游渠道 #249

Open
5 tasks done
imldy opened this issue Jul 5, 2023 · 9 comments
Open
5 tasks done

消费日志中记录使用的上游渠道 #249

imldy opened this issue Jul 5, 2023 · 9 comments
Labels
enhancement New feature or request priority This will have high priority.

Comments

@imldy
Copy link

imldy commented Jul 5, 2023

例行检查

  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我已完整查看过项目 README,已确定现有版本无法满足需求
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

功能描述

日志关联上游渠道。
可通过id关联,但id可能会重复(比如id最大值的渠道被删除后,重新添加渠道,id会复用)
可通过渠道名关联,但渠道名也可能重复。
哪怕仅仅记录渠道名和id。

应用场景

管理员查看渠道的使用记录,用于查看one-api对哪些渠道发起了哪些请求。

@imldy imldy added the enhancement New feature or request label Jul 5, 2023
@songquanpeng
Copy link
Owner

如果报错了终端的日志是有记录渠道 id 的,正常请求的情况下记录是哪一个渠道的意义不大。

@lipanpan-hub
Copy link

Snipaste_2023-07-21_20-19-04

这种不响应的 可以 查看哪个渠道在作妖

@songquanpeng
Copy link
Owner

那看来还是有这个需求

@imldy
Copy link
Author

imldy commented Aug 1, 2023

还有一个场景:随着查使用量接口v1/dashboard/billing/usage更改为只能使用sessionKey查询,查余额功能几乎算是废了。所以消费日志中关联上游渠道,就可以在OneAPI中统计出上游渠道的本月使用量、总使用量,近似得出余额,这类似于手机本地统计流量消耗。

@songquanpeng
Copy link
Owner

songquanpeng commented Aug 1, 2023 via email

@esojourn
Copy link

esojourn commented Aug 2, 2023

+1 关注

1 similar comment
@Pa5sw0rd
Copy link

Pa5sw0rd commented Aug 4, 2023

+1 关注

@520hacker
Copy link

image
期待更新。

@songquanpeng songquanpeng added the priority This will have high priority. label Aug 27, 2023
@tdouguo
Copy link

tdouguo commented Aug 31, 2023

+1 希望在错误时候记录下上游渠道id 以便查看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority This will have high priority.
Projects
None yet
Development

No branches or pull requests

7 participants