-
Notifications
You must be signed in to change notification settings - Fork 0
Config json schema generation #78
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
base: main
Are you sure you want to change the base?
Conversation
3acc24c to
3c6e393
Compare
cmd/obi-schema/main.go
Outdated
| for _, pkg := range packagesToScan { | ||
| pkgPath := filepath.Join(moduleRoot, pkg) | ||
| if err := scanPackageForEnums(pkgPath); err != nil { | ||
| fmt.Fprintf(os.Stderr, "Warning: error scanning %s: %v\n", pkg, err) |
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.
is this a warning or an error?
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.
yeah probably an error, will fix
cmd/obi-schema/main.go
Outdated
|
|
||
| func scanPackageForEnums(pkgPath string) error { | ||
| fset := token.NewFileSet() | ||
| pkgs, err := parser.ParseDir(fset, pkgPath, nil, parser.ParseComments) |
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.
ParseDir is deprecated
pinoOgni
left a comment
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.
very cool! Left some comments
| @@ -133,6 +133,7 @@ type PrometheusConfig struct { | |||
|
|
|||
| // Registry is only used for embedding Beyla within the Grafana Agent. | |||
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.
Beyla -> OBI (also for next line)
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.
this is a beyla specific comment, becuase the embedding is beyla
so i left the comment but i added a new line so it wont be included in the schema
mmat11
left a comment
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!
TODO:
Read DefaultConfig struct and attach default config
Some fields only specify in comments what their possible fields are, making them a Named String type can make the schema more accurate with enums
Checklist