Skip to content

Conversation

@emschwartz
Copy link
Contributor

Resolves #80

@emschwartz emschwartz requested review from a team and arendjr May 26, 2023 09:55
// Build the documentation we'll add to the function's RustDocs
let metrics_docs = create_metrics_docs(&prometheus_url, &function_name, args.track_concurrency);
// Build the documentation we'll add to the function's RustDocs, unless it is disabled by the environment variable
let metrics_docs = if option_env!("AUTOMETRICS_DISABLE_DOCS").is_some() {
Copy link

Choose a reason for hiding this comment

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

option_env! works at compile-time. Is that really what we want? I see PROMETHEUS_URL uses the regular env::var() function, which I think I would've expected here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TBH, I'm not sure it makes a difference because the macros are only run at compile time. But I can change it anyway

Copy link

Choose a reason for hiding this comment

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

Yeah, I also found it hard to reason about what it means for something to be done at compile-time for a macro. Maybe avoiding the confusion is reason enough :)

@emschwartz emschwartz merged commit 6bceaf4 into main May 26, 2023
@emschwartz emschwartz deleted the disable-docs-gen branch May 26, 2023 11:16
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.

Support AUTOMETRICS_DOCS_GEN=0 environment variable

3 participants