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

feat: inputs/powerdns: Add underscore option #10021

Closed
wants to merge 2 commits into from

Conversation

isodude
Copy link
Contributor

@isodude isodude commented Oct 29, 2021

When telegraf's metrics are eventually polled via PromQL,
dash in metric names are not supported.

Allow dash to be converted to underscore.

Required for all PRs:

In my case I'm using telegraf to send Influx to VictoriaMetrics,
which in it's turn offer PromQL to Grafana. It does not like dash in Measurements.

Current workaround is to use {name="powerdns_field-name"}, which is a hassle.
This makes it possible to use powerdns_field_name{} instead.

@isodude isodude force-pushed the patch-1 branch 2 times, most recently from 7c8efc8 to 9339bf0 Compare October 29, 2021 06:17
isodude and others added 2 commits October 29, 2021 08:22
When telegraf's metrics are eventually polled via PromQL,
dash in metric names are not supported.

Allow dash to be converted to underscore.

Signed-off-by: Josef Johansson <josef@oderland.se>
When telegraf's metrics are eventually polled via PromQL,
dash in metric names are not supported.

Allow dash to be converted to underscore.

Signed-off-by: Josef Johansson <josef@oderland.se>
@telegraf-tiger
Copy link
Contributor

🥳 This pull request decreases the Telegraf binary size by -1.10 % for linux amd64 (new size: 130.7 MB, nightly size 132.2 MB)

📦 Looks like new artifacts were built from this PR.

Expand this list to get them here! 🐯

Artifact URLs

DEB RPM TAR GZ ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm freebsd_amd64.tar.gz windows_i386.zip
armel.deb armv6hl.rpm freebsd_armv7.tar.gz
armhf.deb i386.rpm freebsd_i386.tar.gz
i386.deb ppc64le.rpm linux_amd64.tar.gz
mips.deb s390x.rpm linux_arm64.tar.gz
mipsel.deb x86_64.rpm linux_armel.tar.gz
ppc64el.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_s390x.tar.gz
static_linux_amd64.tar.gz

@Hipska
Copy link
Contributor

Hipska commented Oct 29, 2021

It doesn't seem right to adapt an input plugin to the limitations of an output plugin (or the systems behind it).

Next to that, have a look at the latest artefacts from #9561 as I think this can cover your problem as well.

@isodude
Copy link
Contributor Author

isodude commented Oct 29, 2021

I just found it odd that it produced the metrics with dash in them. It felt off?
I can circumvent but shouldn't fields generally be in the form field_key?

@Hipska
Copy link
Contributor

Hipska commented Oct 29, 2021

That's indeed more common, but there are also plugins that produce CamelCase names..

@isodude
Copy link
Contributor Author

isodude commented Oct 29, 2021

What are your views around field names, should they always be the same? Or should all output plugins have to possibility to support CamelCase, dash and underscore via a generic function? Controlling output_format=camelcase|dash|underscore instead.

@Hipska
Copy link
Contributor

Hipska commented Oct 29, 2021

If a specific output doesn't accept a field/tag/metric format, it should warn/error the user or convert if possible. There are processor plugins that can rename field/tag/metric names and/or values. In my opinion, there is nothing to be fixed on the input, you might want to test the given PR if that solves your issues. You could however provide a fix for the output plugin if really wanted, but I don't think this is relevant in this case as well.

@isodude
Copy link
Contributor Author

isodude commented Oct 29, 2021

Ok, thanks for the clear answers!

@isodude isodude closed this Oct 29, 2021
@isodude isodude deleted the patch-1 branch November 1, 2021 09:44
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.

2 participants