cds
cds copied to clipboard
UI metrics missing
We tried to implement metrics collection on a CDS instance. Documentation is unfortunately lacking in this respect. It was our impression that metrics data should be exposed on the endpoint /mon/metrics which appears to be working on most components (API, hooks, etc.), but not on UI, which returns
{"id":38,"message":"resource not found","request_id":"9483067c-6d92-44ad-acd4-678a4b47a681"}
Should we be able to get metrics info from the UI component or is this intended?
Hi @kovacsur , do you have more logs in ui service associated to this request_id ?
Hello @yesnault
This is a log from the CDS UI service.
The HTTP response has been the same as @kovacsur :
{ "id": 38, "message": "resource not found", "request_id": "bd9f02e4-15e8-40e0-ae0d-9f35d7c5e3bf" }
HI @martikan , Do you have something like that configured in your ui service ?
[telemetry]
metricsEnabled = true
tracingEnabled = true
[telemetry.Exporters]
[telemetry.Exporters.Jaeger]
HTTPCollectorEndpoint = "https://your-jaeger-server:12345"
collectorEndpoint = "https://your-jaeger-server:12345/api/traces"
samplingProbability = 0.25
serviceName = "Your-Team-Service-Here"
[telemetry.Exporters.Prometheus]
ReporteringPeriod = 10
Do you have some INFO log containing observability> in you ui service ?
Feel free to reopen if needed.
Hi @yesnault, thank you for your help. The problem really is connected to our conf.toml
Unfortunately metricsEnabled = true is missing from our configuration even tho we call
/app/cds-engine-linux-amd64 config edit /app/conf/conf.toml --output /app/conf/conf.toml \
log.level=info \
ui.enableServiceProxy=true \
ui.name=$(hostname)\
ui.url=http://nc2347-admin-ns-ui:8080 \
ui.api.http.url=http://nc2347-admin-ns-api:8081 \
ui.hooksURL=http://nc2347-admin-ns-hooks:8083 \
ui.api.token=$TOKEN \
ui.cdnURL=http://nc2347-admin-ns-cdn:8089 \
telemetry.metricsEnabled=true
Notice the last line setting metricsEnabled to true. This command seems to work for altering certain variables like tracingEnabled but has no effect on metricsEnabled.
Digging deeper I found a suspicious part in the source code:
// Configuration is the global tracing configuration
type Configuration struct {
TracingEnabled bool `toml:"tracingEnabled" json:"tracingEnabled"`
Exporters struct {
Jaeger struct {
ServiceName string `toml:"serviceName" default:"" json:"serviceName"`
CollectorEndpoint string `toml:"collectorEndpoint" default:"http://localhost:14268/api/traces" json:"collectorEndpoint"`
SamplingProbability float64 `toml:"samplingProbability" json:"metricSamplingProbability"`
} `json:"jaeger"`
Prometheus struct {
ReporteringPeriod int `toml:"ReporteringPeriod" default:"10" json:"reporteringPeriod"`
} `json:"prometheus"`
} `json:"exporter"`
}
I suppose that the available variables to set are specified here as exactly these variables are present in our config file but again metricsEnabled is missing from here as well.
@yesnault Could you please reopen the ticket? We don't have the required permissions to do so.
Manually adding the (apparently no longer supported) metricsEnabled flag did not solve the issue, as described above. The issue still persists, ie. no metrics data is published by the UI component even though the same configuration works for other components.