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

UI metrics missing #6168

Open
kovacsur opened this issue May 9, 2022 · 5 comments
Open

UI metrics missing #6168

kovacsur opened this issue May 9, 2022 · 5 comments

Comments

@kovacsur
Copy link

kovacsur commented May 9, 2022

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?

@yesnault
Copy link
Member

yesnault commented Jul 5, 2022

Hi @kovacsur , do you have more logs in ui service associated to this request_id ?

@martikan
Copy link

Hello @yesnault

This is a log from the CDS UI service.

cds_logs_20220912.txt

The HTTP response has been the same as @kovacsur :
{ "id": 38, "message": "resource not found", "request_id": "bd9f02e4-15e8-40e0-ae0d-9f35d7c5e3bf" }

@yesnault
Copy link
Member

yesnault commented Sep 19, 2022

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.

@atttorok
Copy link

atttorok commented Oct 3, 2022

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.

@kovacsur
Copy link
Author

kovacsur commented Oct 3, 2022

@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.

@yesnault yesnault reopened this Oct 3, 2022
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

No branches or pull requests

4 participants