Coder Social home page Coder Social logo

Comments (3)

powersj avatar powersj commented on June 3, 2024 1

Hi,

In this part of the code, the replication_role label is being overwritten as slave. By commenting out this section, the replication_role label correctly reflects master as expected. Here is an example showing the correct behavior after the modification:

The function that you are pointing to parses lines that start with slave (e.g. ^slave\d+). That means from the example output you provided it is parsing the following data:

slave0:ip=127.0.0.1,port=6384,state=online,offset=2870,lag=1
slave1:ip=127.0.0.1,port=6380,state=online,offset=2870,lag=1
slave2:ip=127.0.0.1,port=6381,state=online,offset=2870,lag=1
slave3:ip=127.0.0.1,port=6383,state=online,offset=2870,lag=1
slave4:ip=127.0.0.1,port=6382,state=online,offset=2870,lag=1

I think, Labeling the replication_role as "slave" for metrics collected from the master server might create some confusion.

I can see that, however I think the intention was to clarify that these metrics are representing a slave not a master, not that the data was collected from a master.

I do not see us suddenly changing the value and meaning of a tag that appears to have been there for 5 years without some major churn to existing users.

Thoughts?

from telegraf.

kell0gg avatar kell0gg commented on June 3, 2024

Thanks for the your comment, I've given it some more thought as you said.

I thought replication_role was not used in other metrics to indicate that the metric is related to a master or slave.

For example, even if there is information related to the master in a node that is a slave, such as the following:

redis-cli -p 6380 info Replication
# Replication
role:slave
master_host:127.0.0.1
master_port:6379
master_link_status:up
master_last_io_seconds_ago:0
...

the replication_role tag is not changed when this metric is collected.

I may also have thought that because I typically use that tag to distinguish between master and replica nodes.

I do not see us suddenly changing the value and meaning of a tag that appears to have been there for 5 years without some major churn to existing users.

I completely agree with your opinion. I think I was too narrow-minded, focusing only on my use case.

I think this issue can be closed. (I'm not sure I understand the issue handling process correctly, so I won't close it for now).
thanks.

from telegraf.

powersj avatar powersj commented on June 3, 2024

Thanks for the response! I will go ahead and close this then.

from telegraf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.