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 zone serial numbers as metrics #91

Conversation

Seitanas
Copy link
Contributor

@Seitanas Seitanas commented Jan 5, 2021

This patch provides zone serial numbers as metrics:

bind_zone_serial{name="168.192.in-addr.arpa",rdataclass="IN",view="_default"} 1
bind_zone_serial{name="TEST_ZONE",rdataclass="IN",view="_default"} 123
bind_zone_serial{name="version.bind",rdataclass="CH",view="_bind"} 0

@Seitanas Seitanas force-pushed the feature/add_zone_serial_numbers_as_metrics branch 3 times, most recently from 7fbbd83 to 2d67cbb Compare January 5, 2021 11:17
@Seitanas
Copy link
Contributor Author

Seitanas commented Jan 6, 2021

@SuperQ could you please review this one?

@SuperQ
Copy link
Contributor

SuperQ commented Jan 6, 2021

I'm not familiar with the rdataclass portion of the schema. Do you have any links to docs on what this is/for?

@Seitanas
Copy link
Contributor Author

Seitanas commented Jan 6, 2021

@SuperQ,

It is mentioned in https://www.ietf.org/rfc/rfc1035.txt


3.2.4. CLASS values

CLASS fields appear in resource records.  The following CLASS mnemonics
and values are defined:
IN              1 the Internet
CS              2 the CSNET class (Obsolete - used only for examples in
                some obsolete RFCs)
CH              3 the CHAOS class
HS              4 Hesiod [Dyer 87]

This is what you configure inside your zone definition:

zone "test.com" IN {   
file "test.zone";   
};

rdataclass will be equal to IN here.

I'm not sure this will be needed, but i didn't want to strip this label, as bind exports it.

@SuperQ
Copy link
Contributor

SuperQ commented Jan 6, 2021

Are we only concerned about zone serials? They would only have IN class. That would mean we could filter for only IN class entries. Then we could drop the label as rdataclass="IN" is implied.

@Seitanas Seitanas force-pushed the feature/add_zone_serial_numbers_as_metrics branch from 2d67cbb to 9687e3b Compare January 6, 2021 10:16
@Seitanas
Copy link
Contributor Author

Seitanas commented Jan 6, 2021

I think you are right about serials being needed only for IN class.
Updated code to filter out other classes than IN

bind_exporter.go Outdated
zoneSerial = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "zone_serial"),
"Zone serial number.",
[]string{"view", "name"}, nil,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit, name is a bit generic, maybe zone or zone_name to make it more specific and less likely to conflict with other (discovery) labels?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. 👍

@SuperQ
Copy link
Contributor

SuperQ commented Jan 6, 2021

MInor nit, otherwise LGTM.

Signed-off-by: Tadas <seitanas@users.noreply.github.com>
@Seitanas Seitanas force-pushed the feature/add_zone_serial_numbers_as_metrics branch from 9687e3b to 2f8cca5 Compare January 6, 2021 12:40
Copy link
Contributor

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

@Seitanas
Copy link
Contributor Author

Seitanas commented Jan 7, 2021

@SuperQ,
what is release cycle of bind_exporter? Is it worth waiting for a binary release, or just use own compiled binaries?

@SuperQ SuperQ merged commit 5c369f1 into prometheus-community:master Jan 7, 2021
@SuperQ
Copy link
Contributor

SuperQ commented Jan 7, 2021

We don't have a specific release cycle, but we can probably do one soon. We're rolling out the https library support, so maybe @roidelapluie would like to add that here.

I also have another bugfix PR open.

SuperQ added a commit that referenced this pull request Jan 12, 2021
* [CHANGE] Replace legacy common/log with promlog #85
* [FEATURE] Add current recursive clients metric #74
* [FEATURE] Add zone serial numbers as metrics #91
* [BUGFIX] Use uint64 for counters in v3 xml. #70
* [BUGFIX] Fix Gauge type for large gauges #90

Signed-off-by: Ben Kochie <superq@gmail.com>
@SuperQ SuperQ mentioned this pull request Jan 12, 2021
SuperQ added a commit that referenced this pull request Jan 14, 2021
* [CHANGE] Replace legacy common/log with promlog #85
* [FEATURE] Add current recursive clients metric #74
* [FEATURE] Add zone serial numbers as metrics #91
* [FEATURE] Add TLS and basic authentication #94
* [BUGFIX] Use uint64 for counters in v3 xml. #70
* [BUGFIX] Fix Gauge type for large gauges #90

Signed-off-by: Ben Kochie <superq@gmail.com>
SuperQ added a commit that referenced this pull request Jan 14, 2021
* [CHANGE] Replace legacy common/log with promlog #85
* [FEATURE] Add current recursive clients metric #74
* [FEATURE] Add zone serial numbers as metrics #91
* [FEATURE] Add TLS and basic authentication #94
* [BUGFIX] Use uint64 for counters in v3 xml #70
* [BUGFIX] Fix Gauge type for large gauges #90

Signed-off-by: Ben Kochie <superq@gmail.com>
SuperQ added a commit that referenced this pull request Jan 14, 2021
* [CHANGE] Replace legacy common/log with promlog #85
* [FEATURE] Add current recursive clients metric #74
* [FEATURE] Add zone serial numbers as metrics #91
* [FEATURE] Add TLS and basic authentication #94
* [BUGFIX] Use uint64 for counters in v3 xml #70
* [BUGFIX] Fix Gauge type for large gauges #90

Signed-off-by: Ben Kochie <superq@gmail.com>
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