Skip to content

Comments

Escape all illegal chars in metric names.#3

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

Escape all illegal chars in metric names.#3
juliusv merged 1 commit intomasterfrom
fix/escape-names

Conversation

@juliusv
Copy link
Member

@juliusv juliusv commented Aug 15, 2013

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

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
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
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
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