Skip to content

Performance: Regex in OpenMetricExporter #452

@maxboehm

Description

@maxboehm

During a load test our prometheus got high response time to collect the metrics.

Investigating into the java stack of our app, I've found that the method OpenMetricsExporter.quoteValue:565 does make use of the method "replaceAll" without a precompiled pattern.

Wouldn't it make sense to precompile the pattern, hold it in a static variable and use the matcher? Not sure, if this is still relevant for the ongoing developments...

grafik

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