Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Provide guidance or api change to enable prefixing of default metrics for asp.net framework web api #491

@alverdal

Description

@alverdal

Hi.
I've followed the instructions on how to setup the default metrics and I see them exposed at /metrics.
AspNetMetricServer.RegisterRoutes(GlobalConfiguration.Configuration);

But I need to prefix all metrics with a custom prefix for each application to be able to separate them in our prometheus server.
Is it possible to rename the default metrics some how or extend that setup to customize the metrics name?

If not can you provide instructions on how to mimik the default metrics and expose them in a .net framework web api?

As an example, I would need these metrics:

process_start_time_seconds 1732705132.45627
process_cpu_seconds_total 12.515625

to be exposed as:

my_application1_process_start_time_seconds 1732705132.45627
my_application1_process_cpu_seconds_total 12.515625

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions