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

Add --inst-all and --rm-all options to generator #73

Merged
merged 3 commits into from
Oct 20, 2023
Merged

Conversation

gagbo
Copy link
Member

@gagbo gagbo commented Oct 13, 2023

Description

These speed up the migration to/from autometrics for bigger, established codebases.

Fixes #72

Checklist

  • The CHANGELOG is updated.
  • The open-telemetry example in repository works fine:
    • the docker compose file is valid
    • the application compiles and run
    • alerts are getting triggered in Prometheus
  • The prometheus example in repository works fine:
    • the docker compose file is valid
    • the application compiles and run
    • alerts are getting triggered in Prometheus
    • exemplars are accessible on the graph

These speed up the migration to/from autometrics for bigger, established
codebases.

Fixes #72
@@ -24,6 +24,8 @@ type args struct {
UseOtel bool `arg:"--otel" default:"false" help:"Use OpenTelemetry client library to instrument code instead of default Prometheus."`
AllowCustomLatencies bool `arg:"--custom-latency" default:"false" help:"Allow non-default latencies to be used in latency-based SLOs."`
DisableDocGeneration bool `arg:"--no-doc,env:AM_NO_DOCGEN" default:"false" help:"Disable documentation links generation for all instrumented functions. Has the same effect as --no-doc in the //autometrics:inst directive."`
ProcessAllFunctions bool `arg:"--inst-all,env:AM_INST_ALL" default:"false" help:"Instrument all function declared in the file to transform. Overwritten by the --rm-all argument if both are set."`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have an alias for this named --install-all? i know this is cool af but i see the potential for confusing typos

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change the argument name sure, I didn't see the inst-all / install bit :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no dont change it its funny, just add an alias :D

@gagbo gagbo merged commit 02f531d into main Oct 20, 2023
7 checks passed
@gagbo gagbo deleted the migration_dx branch October 20, 2023 09:38
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

Successfully merging this pull request may close these issues.

Add an option on the go generator to instrument all functions in the file
2 participants