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

allow to use variables in "status_zone" string #52

Open
slimlv opened this issue Oct 20, 2023 · 3 comments
Open

allow to use variables in "status_zone" string #52

slimlv opened this issue Oct 20, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@slimlv
Copy link

slimlv commented Oct 20, 2023

I'm looking for a way to dynamically create metrics using variables in status_zone directive, like

server_name example.com domain.ru;
status_zone ${host}_server;

I hope this will allow to export prometheus metrics per used domain name later in template

@VBart
Copy link
Contributor

VBart commented Oct 20, 2023

Hi,

You can use any template engine to process Angie config and generate relevant status_zone directives.

All internal variables exist and processed in runtime only, while status_zone must know its name before starting worker processes in order to be able to allocate all the required shared memory zones where the relevant metrics are stored.

@VBart VBart added the enhancement New feature or request label Oct 20, 2023
@slimlv
Copy link
Author

slimlv commented Oct 21, 2023

my config contains multiple names under same server section.
It would be neat to be able to provide some context to status_zone directive right in place

@VBart
Copy link
Contributor

VBart commented Oct 21, 2023

my config contains multiple names under same server section. It would be neat to be able to provide some context to status_zone directive right in place

Understood. Thanks. We will consider how Angie metrics API can be improved for this particular case in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants