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

Inprogress metrics ignore namespace and subsystem #285

Open
jhuitema opened this issue Feb 16, 2024 · 0 comments
Open

Inprogress metrics ignore namespace and subsystem #285

jhuitema opened this issue Feb 16, 2024 · 0 comments

Comments

@jhuitema
Copy link

When I try to use the inprogress metrics, the metric_namespace and metric_subsystem settings are ignored.

Reproduction example

_APP = FastAPI(
    title="MyApp",
    version=__version__,
)
_PROM_INST = Instrumentator(
    should_instrument_requests_inprogress=True,
    inprogress_labels=True,
)
_PROM_INST.instrument(_APP, metric_namespace="myapp", metric_subsystem="webapi")
_PROM_INST.expose(_APP)

Result

This creates a http_requests_inprogress metric instead of the myapp_webapi_http_requests_inprogress metric I would expect.

Workaround

I can get around this by setting my own inprogress_name to include the namespace and subsystem but it would be more convenient if it was done for me.

Potential Fix

I think this could be fixed by adding the metric_namespace and metric_subsystem to this line.

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

No branches or pull requests

1 participant