lancerdima opened a new issue #1904:
URL: https://github.com/apache/camel-k/issues/1904


   Referring to the Camel K integration monitoring documentation page 
(https://camel.apache.org/camel-k/latest/observability/integration.html)
   
   ### Scenario
   1) Camel K is installed (either with Helm chart, or kamel CLI), but no 
monitoring was enabled
   2) We need to enable monitoring for integrations
   3) We use command as outlined in the documentation:
   `$ kubectl patch ip camel-k --type=merge -p 
'{"spec":{"traits":{"prometheus":{"configuration":{"enabled":"true"}}}}}'`
   
   ### Problem
   The operator fails to process the updated IntegrationPlatform configuration 
and reports an error
   
`{"level":"error","ts":1610479910.1079845,"logger":"controller","msg":"Reconciler
 
error","controller":"integration-controller","name":"account-from-salesforce-kafka","namespace":"camel-k","error":"error
 during trait customization: json: cannot unmarshal string into Go struct field 
prometheusTrait.enabled of type bool","errorVerbose":"json: cannot unmarshal 
string into Go struct field prometheusTrait.enabled of type bool\nerror during 
trait 
customization\ngithub.com/apache/camel-k/pkg/trait.Apply\n\tgithub.com/apache/camel-k/pkg/trait/trait.go:47\ngithub.com/apache/camel-k/pkg/controller/integration.(*platformSetupAction).Handle\n\tgithub.com/apache/camel-k/pkg/controller/integration/platform_setup.go:54\ngithub.com/apache/camel-k/pkg/controller/integration.(*reconcileIntegration).Reconcile\n\tgithub.com/apache/camel-k/pkg/controller/integration/integration_controller.go:287\ngithub.com/apache/camel-k/pkg/util/monitoring.(*instrumentedReconciler).Reconcile\n\tgithub.com/apache/came
 
l-k/pkg/util/monitoring/controller.go:70\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:244\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:218\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:197\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\tk8s.io/[email protected]/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\tk8s.io/[email protected]/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tk8s.io/[email protected]/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\tk8s.io/[email protected]/pkg/util/wait/wait.go:90\nruntime.goexit\n\truntime/asm_amd64
 
.s:1373","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tgithub.com/go-logr/[email protected]/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:246\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:218\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:197\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\tk8s.io/[email protected]/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\tk8s.io/[email protected]/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tk8s.io/[email protected]/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\tk8s.io/apimachiner
 [email protected]/pkg/util/wait/wait.go:90"}`
   
   ### Required change
   It might be that issue is caused by the same problem as highlighted in this 
comment (https://github.com/apache/camel-k/issues/1648#issuecomment-667999900)
   
   If I replace `enabled: "true"` with `enabled: true` everything works - thus 
documentation adjustment might be sufficient to address the issue.
   
   I am also suggesting to add this snippet to the documentation to help those 
who are configuring IntegrationPlatform CLI directly as yaml file, without the 
help of kamel CLI. As well as highlight the importance of 
`camel-k-operator-servicemonitors` Role and RoleBinding
   ```
   spec:
     traits:
       prometheus:
         configuration:
           enabled: true
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to