adejoux / nmon2influxdb

Make NMON data dynamic with InfluxDB
GNU Affero General Public License v3.0
80 stars 29 forks source link

Global or Subset Tagging #36

Closed awilson77584 closed 7 years ago

awilson77584 commented 7 years ago

Thanks for the custom tagging feature. In our use case all of the measurements for a given LPAR would have the same tags. For example, the same tag set will apply for the CPU_ALL measurement as for the DISKAVGRIO measurement. Is it feasible to add a [[global input]] section? That way each measurement would not require a specific [[input]] section.

adejoux commented 7 years ago

Hello,

I was thinking about implementing it at first but I am wondering if using templating will not solve your issue without needing to tag all measurements of the partition. Adding tags increase cardinality and increase memory usage of influxdb. So if we can avoid it, it's better. I am testing if I should not move some tags in fields instead.

About templating, if you create a template variable named Datacenter and fetching all available tag values from a common tag like CPU_ALL for nmon:

image

You can use the result to filter the list of partitions: image

And so you can filter them like that:

image

Here my example is using HMC inputs but it's possible to do the same with nmon data.

Let me know what you think about this. I am pretty open on this issue :)

Thanks,

Alain

awilson77584 commented 7 years ago

Thanks!. We'll work with this and get back to you.

Alan

madhuioe commented 7 years ago

Hi Alain, I apologize for delayed response on this issue. Actually, I responded on issue #38 and these are correlated. The custom tags and templates features are added on 2.1.0 release. Since hmc parameters are added, I am unable to import data to influxdb because of configuration issue. Likewise, I am unable to test on tagging and templates part as you mentioned.

Thanks a lot for your great work. Hope it will be addressed in new release.

Thanks, Madhu

adejoux commented 7 years ago

Hello :)

Ok. I understand. Let's continue the investigation on issue #38 for now. We will come back when it will work for you :)

Thanks,

Alain

madhuioe commented 7 years ago

Hi Alain, I am working into tagging part as well considering nmon data as sample because nmon2influxdb import couldn't proceed on hmc7. I have applied tagging on windows and linux at source level and then we were able to create template variable using tags.

In AIX system, I created tags BUSINESSCLASS, HOSTTYPE, LOCATION and OSTYPE and created BUSINESSCLASS template for CPU_ALL measurement and applied to other measurements too. I am unable to get the tag information for rest of the measurements. tag capture Could you please suggest into it?

Thank you, Madhu

adejoux commented 7 years ago

Hello,

I reviewed your queries.

I tried to reproduce your problem.

I put this entry in the configuration file to match your tag jeys:

[[input]]
  Measurement="CPU_ALL"
  Name="host"
  Match="itmup"
  [[input.tag]]
    Name="BUSINESSCLASS"
    Value="GOLD"
  [[input.tag]]
    Name="HOSTTYPE"
    Value="PHYSICAL"
  [[input.tag]]
    Name="OSTYPE"
    Value="AIX"
  [[input.tag]]
    Name="REGION"
    Value="NA"

I just changed the match value to match my nmon host.

After import, you can check in influx command like that:

show tag keys from "CPU_ALL"
name: CPU_ALL
tagKey
------
BUSINESSCLASS
HOSTTYPE
OSTYPE
REGION
host
name

Please check this one.

After that, I run your first query:

> show tag values from "CPU_ALL" with key = "BUSINESSCLASS"
name: CPU_ALL
key     value
---     -----
BUSINESSCLASS   GOLD

I see the value GOLD like planned.

It's the same in Grafana:

image

After that the other queries should be changed.

You need to make nested queries. If you choose BUSINESSCLASS GOLD you don't want to see all the HOSTTYPE but only the ones belonging also to the category GOLD.

the query is:

show tag values from "CPU_ALL" with key = "HOSTTYPE" where BUSINESSCLASS =~ /$BUSINESSCLASS/

And at the end I think you want to choose a host.

So let's make a last query(it would be the same for OSTYPE and REGION):

show tag values from "CPU_ALL" with key = "host" where BUSINESSCLASS =~ /$BUSINESSCLASS/ and HOSTTYPE =~ /$HOSTTYPE/

image

Another point is for each variable you should choose when you want the values to be refreshed. I think on dashboard load is good but it's depending on your usage :)

image

Hope it will works for you :)

Alain

adejoux commented 7 years ago

I forgot to say but you need to update the chart to use the variable HOST.

Another example:

image

And you see, I am using this variable in another measurement. It's why I think global measurement is not needed but it's up for discussion :)

Thanks,

Alain

madhuioe commented 7 years ago

Hi Alain, Thanks for the details. Still I am not getting tagging results as expected. We have 4 types of tags : BUSINESSCLASS, HOSTTYPE, LOCATION, OSTYPE for measurements: CPU_ALL, DISKAVGRIO, DISKAVGWIO, DISKBSIZE, DISKBUSY .........................VGXFER for nmon categories.

Instead of going through long list of taggings for all measurements, we applied tags to CPU_ALL and added it into nmon2influxdb config file. Based on previous discussion, I created the templates and used for other measurements too as required. Actions:

  1. Selected measurement "DISKAVGRIO": corresponding result is shown in Screen1.
  2. Added: host =~/^host$/ : corresponding result is shown in Screen2.
  3. Added: BUSINESSCLASS=/^BUSINESSCLASS$/ : the result is depicted into screen3. Based on 3rd category, I am unable to obtain tags to the measurements in which tagging is not applied into config file. tagging.docx

Could you please suggest solution on 3rd scenario how tags are obtained to those measurements without configuring previously?

Thanks, Madhu

adejoux commented 7 years ago

Hello, I looked at it.

In this one, you need to remove "AND BUSINESSCLASS =~/$BUSINESSCLASS$/"

image

$host should be enough if it's nested query like this one:

show tag values from "CPU_ALL" with key = "host" where BUSINESSCLASS =~ /$BUSINESSCLASS/ 

You should only use $host in your charts. $host will be the result of your selection.

I have only one aix host on my demo web site but I added an example to show you how it can be done:

http://demo.nmon2influxdb.org/dashboard/db/aixlpar-tagged-nmon-report

Login/password: demo/demo

You can check it how I did it.

Let me know if you have other questions.

Alain

madhuioe commented 7 years ago

Hi Alain, It worked after recommended modification and also attaching the same. Thanks a lot for your continuous support. tagging

Thanks, Madhu

adejoux commented 7 years ago

Hello,

Great news :) closing this issue :)

adejoux commented 7 years ago

I wrote an post explaining how tagging works: https://www.djouxtech.net/posts/nmon2influxdb-tagging-partitions/