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

fix(collector): fix the concurrency problem caused by multiple execut… #1859

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

limowang
Copy link
Collaborator

No description provided.

…ions of the initMetric function in multiple threads
Comment on lines +181 to +184
GaugeMetricsMap = make(map[string]prometheus.GaugeVec, 256)
CounterMetricsMap = make(map[string]prometheus.CounterVec, 256)
SummaryMetricsMap = make(map[string]prometheus.Summary, 256)
TableNameByID = make(map[string]string, 256)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we define these as the members of struct rather than the global variables ?

@acelyc111
Copy link
Member

@limowang Please keep in mind that the PR title will be cut if it's too long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants