Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for stripping host from metics! #35

Open
DoctorOgg opened this issue Apr 15, 2020 · 4 comments
Open

Add support for stripping host from metics! #35

DoctorOgg opened this issue Apr 15, 2020 · 4 comments

Comments

@DoctorOgg
Copy link

I'm working on migration to sensu-go, and I'm using the legacy sensu, the older influxdb handler supports stripping the hostname from the metric. I have included my configs and a sample query I'm using on the older sensu install. this older format allows systems to be added and removed from my dashboards without changing the query.

{
  "influxdb": {
    "host": "sensu_influxdb",
    "port": 8086,
    "database": "sensu",
    "username": "sensu",
    "password": "sensu",
    "strip_metric": "host"
  }
}
q:"SELECT "value" FROM "memory_percent.usedWOBuffersCaches" WHERE ("host" =~ /^node/) AND time >= now() - 6h GROUP BY "host""

Thanks

@nikkictl
Copy link

@DoctorOgg can you provide me with the link to the repo or documentation for the InfluxDB handler you are referring to? I can not validate the strip_metric argument in the supported Sensu Enterprise InfluxDB integration.

@magnuslarsen
Copy link

Not OP, but I have to same request :-)

In our old Sensu Core installation, we used Telegraf (from Influx) to pick up metrics in the Graphite format. Telegraf then sent it to a Sensu handler (UDP, listens on a socket, only_check_output mutator attached).
That stripped the hostnames of the metric it self, allowing you to create queries like this:

SELECT mean("all_cpus") FROM "ipmi" WHERE ("host" = 'my_hostname') AND $timeFilter GROUP BY time($__interval) fill(null)

The new influxdb-handler already sets a entity_name-tag, with the entity name in it. Having it also in the metric name is redundant:

SELECT mean("ipmi.all_cpus") FROM "my_hostname" WHERE ("sensu_entity_name" = 'my_hostname') AND $timeFilter GROUP BY time($__interval) fill(null)

This also means that you can't create graphs on spanning multiple hosts (here I'm thinking Grafana's variable for entity_name), since the hostname is also the name of the series (instead of just the metric)

Being able to strip the hostnames of the metrics, allows the "Sensu Core metrics" to be compatible with Sensu Go :-)

@nikkictl
Copy link

@magnuslarsen Thanks for sharing your support of this issue. It sounds like this feature would be useful to a good number of users, so I'll do my best to keep #39 moving along.

@DoctorOgg
Copy link
Author

sorry, just flowing up, I thought it was the official influx handler that was doing this for sensu core. this was a blocker for me moving to sensu go, however, in the long run, i ended up dropping the dataset, and rebuilding all my queries to get moving... so I haven't been using sensu core for a while now.

nikkictl pushed a commit that referenced this issue Sep 1, 2020
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

No branches or pull requests

3 participants