apache / apache/brpc

支持用户对bvar名称做自定义的归一化处理

Open
#1,445 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

**需求背景**
有些用户自定义名称可能有特殊含义,比如 "3AE5D89",会被规化成 "3_AE_5_D_89",这种规一化会对展现,以及监控等配置造成困扰。

**Describe the solution you'd like (描述你期望的解决方法)**
增加一个全局的name_normalization_func,默认值为to_underscored_name

typedef void (*name_normalization_func)(std::string* name, const base::StringPiece& src);
name_normalization_func g_name_normalization = to_underscored_name;

如果用户需要对bvar名称做自定义的归一化处理,只需要调用set_name_normalization_func
void set_name_normalization_func(name_normalization_func func_name);

Contributor guide

Open the contributing guide

Research direction

Start by locating bvar's existing name normalization path and the to_underscored_name function. Trace how bvar names are created, then assess where the global name_normalization_func and set_name_normalization_func entry point belong; done means callers can provide custom normalization while the default behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.