Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.

Rename labels to be more consistent #31

Open
marcbachmann opened this issue Sep 1, 2017 · 3 comments
Open

Rename labels to be more consistent #31

marcbachmann opened this issue Sep 1, 2017 · 3 comments

Comments

@marcbachmann
Copy link

marcbachmann commented Sep 1, 2017

Currently the rancher_stack_health_status and rancher_service_* metrics both have a name.
In some cases it's a stack name and sometimes a service name.

It would be nice to have a more consistent naming of labels. I advise to rename the labels to stack_name and service_name.
What do you think about that?

Here's how my metric relabel config looks like:

    metric_relabel_configs:
      - action: 'replace'
        source_labels: ['__name__', 'name']
        regex: 'rancher_stack_health_status;(.+)'
        target_label: 'stack_name'

      - action: 'replace'
        source_labels: ['__name__', 'name']
        regex: '(rancher_service_health_status|rancher_service_scale|rancher_service_state);(.+)'
        replacement: '$2'
        target_label: 'service_name'

      - action: 'replace'
        source_labels: ['__name__', 'exported_stack_name']
        regex: '(rancher_service_health_status|rancher_service_scale|rancher_service_state);(.+)'
        replacement: '$2'
        target_label: 'stack_name'

      - action: 'replace'
        source_labels: ['__name__']
        regex: 'rancher_service_[a-z_]*'
        replacement: ''
        target_label: 'exported_stack_name'

      - action: 'replace'
        source_labels: ['__name__']
        regex: '(rancher_stack_health_status|rancher_service_health_status|rancher_service_scale|rancher_service_state)'
        replacement: ''
        target_label: 'name'
@Rucknar
Copy link
Contributor

Rucknar commented Sep 2, 2017

Agree @marcbachmann something I only really appreciated once the exporter was published.

The problem we would have is that metric names have quite an impact when changed, this exporters had over 1m pulls on docker hub surprisingly so i'd be hesitant to introduce such a breaking change.

@marcbachmann
Copy link
Author

Yeah, that would be a breaking change. What about making it configurable and log a deprecation message?

@Rucknar
Copy link
Contributor

Rucknar commented Sep 6, 2017

Fair point. Should get time to look at this next week, open to PR's of course.

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

No branches or pull requests

3 participants