Skip to content

Escape all illegal chars in metric names. - #3

Merged
juliusv merged 1 commit into
masterfrom
fix/escape-names
Aug 15, 2013
Merged

juliusv merged 1 commit into
masterfrom
fix/escape-names

Conversation

@juliusv

@juliusv juliusv commented Aug 15, 2013

Copy link
Copy Markdown
Member

E.g. right now there are some metrics with dashes in their names, which cannot
be queried through the UI.

E.g. right now there are some metrics with dashes in their names, which cannot
be queried through the UI.
@ghost ghost assigned discordianfish Aug 15, 2013

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You are omitting the lowercasing. Is that intended?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To me, the regex looks good. The ^ negates the whole character group.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, capitals are legal.
On Aug 15, 2013 1:23 PM, "Matt T. Proud" notifications@github.com wrote:

In exporter/gmond_collector.go:

@@ -84,7 +86,7 @@ func (c *gmondCollector) Update() (updates int, err error) {
for _, host := range cluster.Hosts {

        for _, metric := range host.Metrics {
  •           name := strings.Replace(strings.ToLower(metric.Name), ".", "_", -1)
    
  •           name := illegalCharsRE.ReplaceAllString(metric.Name, "_")
    

You are omitting the lowercasing. Is that intended?


Reply to this email directly or view it on GitHubhttps://github.com//pull/3/files#r5787896
.

@discordianfish

Copy link
Copy Markdown
Member

👍

juliusv added a commit that referenced this pull request Aug 15, 2013
Escape all illegal chars in metric names.
@juliusv
juliusv merged commit 94065ff into master Aug 15, 2013
@juliusv
juliusv deleted the fix/escape-names branch August 15, 2013 12:46
tamcore pushed a commit to gitgrave/node_exporter that referenced this pull request Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants