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

Added country information to Mentix #924

Merged
merged 9 commits into from
Jul 1, 2020
2 changes: 2 additions & 0 deletions pkg/mentix/connectors/gocdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ func (connector *GOCDBConnector) querySites(meshData *meshdata.MeshData) error {
Homepage: site.Homepage,
Email: site.Email,
Description: site.Description,
Country: site.Country,
CountryCode: site.CountryCode,
Services: nil,
Properties: properties,
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/mentix/connectors/gocdb/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ type Site struct {
Homepage string `xml:"HOME_URL"`
Email string `xml:"CONTACT_EMAIL"`
Domain string `xml:"DOMAIN>DOMAIN_NAME"`
Country string `xml:"COUNTRY"`
CountryCode string `xml:"COUNTRY_CODE"`
Extensions Extensions `xml:"EXTENSIONS"`
}

Expand Down
1 change: 1 addition & 0 deletions pkg/mentix/exporters/promfilesd.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func (exporter *PrometheusFileSDExporter) createScrapeConfigs() []*prometheus.Sc
func (exporter *PrometheusFileSDExporter) createScrapeConfig(site *meshdata.Site, host string, endpoint *meshdata.ServiceEndpoint) *prometheus.ScrapeConfig {
labels := map[string]string{
"site": site.Name,
"country": site.CountryCode,
"service_type": endpoint.Type.Name,
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/mentix/meshdata/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ type Site struct {
Homepage string
Email string
Description string
Country string
CountryCode string
Location string

Services []*Service
Properties map[string]string
Expand Down