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

Adds ifAlias label to all exported metrics. #16

Merged
merged 1 commit into from
Sep 21, 2020
Merged

Conversation

nkinkade
Copy link
Contributor

@nkinkade nkinkade commented Sep 18, 2020

It is handy to have an ifAlias label on all switch metrics so that we can easily query for a particular machine or the "uplink" without having to fuss with interface names (e.g., xe-0/0/12, xe-0/0/45, ge-0/0/47, etc.). ifAlias is currently added to all metrics collected with snmp_exporter. This PR adds an ifAlias label to all metrics exported by DISCOv2.


This change is Reviewable

Copy link

@stephen-soltesz stephen-soltesz left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @nkinkade and @stephen-soltesz)


metrics/metrics.go, line 77 at r1 (raw file):

			oidMap, err := getOidsString(client, []string{ifDescrOid})
			rtx.Must(err, "Failed to determine the machine interface ifDescr")
			ifaces["machine"]["ifAlias"] = machine

just to check, sometimes machine means "mlab1" and sometimes it means the fqdn. in this case, the label is just the short form?

Copy link
Contributor Author

@nkinkade nkinkade left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @stephen-soltesz)


metrics/metrics.go, line 77 at r1 (raw file):

Previously, stephen-soltesz (Stephen Soltesz) wrote…

just to check, sometimes machine means "mlab1" and sometimes it means the fqdn. in this case, the label is just the short form?

That's right. In this case, machine refers only to mlab[1-4]: https://github.com/m-lab/disco/blob/master/metrics/metrics.go#L259. But you're right that maybe I've chosen a bad name here, since it is possibly ambiguous, especially if I've used "machine" to mean the FQDN in other places.

@nkinkade nkinkade merged commit f538650 into master Sep 21, 2020
@nkinkade nkinkade deleted the sandbox-kinkade branch September 23, 2020 18:49
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