-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: using go-kit fields plus minor improvements #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I am thinking rudder-go-kit should depend on obs-kit, should we move the functionality related to observability to obs kit?
Shall we introduce a github action ensuring the generators have been executed, something like this |
var ( | ||
UploadId = name[int]("uploadId") | ||
UploadTime = name[Time]("uploadTime") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this removed intentionally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the old name[T]
was replaced with the gokit/logger.Field
.
If you're referring to UploadTime
, I want to tackle the fields that we'll need in separate PRs. Here we're just putting down some ground work then we can do a dedicated PR where we just add stuff to the labels.yaml
file and generate.
go/labels/warehouse.go
Outdated
var ( | ||
UploadId = name[int]("uploadId") | ||
UploadTime = name[Time]("uploadTime") | ||
UploadID = func(v int64) log.Field { return log.NewIntField("uploadId", v) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[non-blocking] Should we introduce a prefix for domain-specific metrics ? or maybe put them in a different package ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We thought about it but avoided it to cause a conflict on purpose to make people rethink the label name. Perhaps if it's a conflict it might be a duplicate. If it's not a duplicate then a prefix can be added manually by changing the label name itself (i.e. by making the label name more verbose/explanatory for example).
@lvrach Done. I pushed a label without generating and the CI broke here: https://github.com/rudderlabs/rudder-observability-kit/actions/runs/6879882237/job/18712820643?pr=5 |
@lvrach @koladilip I added also linters and checkers that linting, go mod tidy and formatting are done properly along with tests running on CI. Since you both approved I'm going to merge as soon as I have a rudder-go-kit version even if the approvals got dismissed (we'll change the setting later). |
DO NOT MERGE: we need a stable version of the go-kit first. Please review: rudderlabs/rudder-go-kit#202 |
Changes
main.go
to always close files on errorteam
todomain
types.go
. ideally we want to be able to understand the majority of what is going on just by looking at the template file and then leave only functions that are too complex for a template totypes.go
Related PRs
For a showcase about how this can be used check the Pull Requests below: