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

Convert some federation labels to lowercase #97

Merged
merged 1 commit into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ Some metrics are not available with Artifactory OSS license. The exporter return
| artifactory_system_license | License type and expiry as labels, seconds to expiration as value | `type`, `licensed_to`, `expires` | ✅ |
| artifactory_system_version | Version and revision of Artifactory as labels. | `version`, `revision` | ✅ |
| artifactory_federation_mirror_lag | Federation mirror lag in milliseconds. | `name`, `remote_url`, `remote_name` | |
| artifactory_federation_mirror_status | Federation mirror status. | `status`, `name`, `remote_url`, `remote_name` | |
| artifactory_federation_unavailable_mirror | Unsynchronized federated mirror status. | `status`, `name`, `remote_url`, `remote_name` | |
| artifactory_federation_repo_status | Synchronization status of the Federation for a repository | `status`, `name`, `remote_url`, `remote_name` | |

* Common labels:
* `node_id`: Artifactory node ID that the metric is scraped from.
Expand Down
2 changes: 1 addition & 1 deletion collector/federation.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (e *Exporter) exportFederationRepoStatus(repoSummary []repoSummary, ch chan

for _, mirrorEventsStatusInfo := range federationRepoStatus.MirrorEventsStatusInfo {
level.Debug(e.logger).Log("msg", "Registering metric", "metric", "federationRepoStatus", "status", mirrorEventsStatusInfo.Status, "repo", repo, "remote_url", mirrorEventsStatusInfo.RemoteUrl, "remote_name", mirrorEventsStatusInfo.RemoteRepoKey)
ch <- prometheus.MustNewConstMetric(federationMetrics["repoStatus"], prometheus.GaugeValue, 1, mirrorEventsStatusInfo.Status, repo, mirrorEventsStatusInfo.RemoteUrl, mirrorEventsStatusInfo.RemoteRepoKey, federationRepoStatus.NodeId)
ch <- prometheus.MustNewConstMetric(federationMetrics["repoStatus"], prometheus.GaugeValue, 1, strings.ToLower(mirrorEventsStatusInfo.Status), repo, strings.ToLower(mirrorEventsStatusInfo.RemoteUrl), mirrorEventsStatusInfo.RemoteRepoKey, federationRepoStatus.NodeId)
}
}
return nil
Expand Down