-
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
Add prometheus env #56
Conversation
- Change verbosity of port to hdrop_port
/// Get a list of all environment variables used in the hdrop backend. | ||
pub fn get_env_vars() -> Vec<String> { | ||
ENV_VARS_BACKEND | ||
.iter() | ||
.map(|&var| var.to_uppercase()) | ||
.collect() | ||
} |
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.
I don't see this being used for anything, what's the purpose?
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.
Given that hdrop-shared contains all formats for the API responses and requests, as well as the names of the metrics and the environment getters, it was a logical choice to include environment variables data in this crate. The objective is to minimize the maintenance required to update the environment variables across multiple tools. A metadata function has therefore been implemented that displays all available environment variables. This allows other programs to fetch these environment variables when using hdrop-shared as a dependency, thereby establishing it as the single source of truth
hdrop-shared/src/env.rs
Outdated
env_get!(cors_origin); | ||
env_get!(single_file_limit_mb => usize); | ||
env_get!(storage_provider); | ||
macro_rules! env_and_const { |
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.
I'd prefer a name like map_env
because it describes an action whereas env_and_const
doesn't, but it's really not that important. Up to you if you wanna change it or not
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.
That is a good suggestion. I will reconsider it later today. The term "generate" or "gen" could also be an appropriate choice.
Closes #38