Skip to content

http接口获取到的 mbvar转prometheus metrics 格式, 提示格式非法 #2082

@highkic

Description

@highkic

Describe the bug (描述bug)
通过brpc_metrics接口获取mbvar 转化来的多lables guage打点,提示type非法
具体的值:

# HELP lat_rank_score_total_latency{system="unknown",module="unknown",server="rank_server_nbase",status="0"}
# TYPE lat_rank_score_total_latency{system="unknown",module="unknown",server="rank_server_nbase",status="0"} gauge
lat_rank_score_total_latency{system="unknown",module="unknown",server="rank_server_nbase",status="0"} 22

To Reproduce (复现方法)

typedef bvar::MultiDimension<bvar::LatencyRecorder> MLatencyRecorder;
MLatencyRecorder lat_rank_score_total("lat_rank_score_total", {"system", "module", "server", "status"});
mbvar_dump=true
mbvar_dump_format= prometheus

打点收集,然后prometheus收集组件通过 http://$ip:$port/brpc_metrics获取打点结果,提示错误

invalid metirc type "system=\"square\" ****** gauge"

Expected behavior (期望行为)
能正常收集

Versions (各种版本)
OS: linux
Compiler: gcc 7.3.1
brpc: 1月10号版master
protobuf: 3.6.0

Additional context/screenshots (更多上下文/截图)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions