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

Integration Monitoring, documentation issue #1904

Closed
lancerdima opened this issue Jan 13, 2021 · 1 comment · Fixed by #1942
Closed

Integration Monitoring, documentation issue #1904

lancerdima opened this issue Jan 13, 2021 · 1 comment · Fixed by #1942
Assignees
Labels
area/documentation Documentation task area/observability Logging, monitoring and tracing

Comments

@lancerdima
Copy link

lancerdima commented Jan 13, 2021

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/camel-k/pkg/util/monitoring/controller.go:70\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.6.3/pkg/internal/controller/controller.go:244\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.6.3/pkg/internal/controller/controller.go:218\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tsigs.k8s.io/controller-runtime@v0.6.3/pkg/internal/controller/controller.go:197\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\tk8s.io/apimachinery@v0.18.9/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\tk8s.io/apimachinery@v0.18.9/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tk8s.io/apimachinery@v0.18.9/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\tk8s.io/apimachinery@v0.18.9/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/zapr@v0.1.1/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.6.3/pkg/internal/controller/controller.go:246\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.6.3/pkg/internal/controller/controller.go:218\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tsigs.k8s.io/controller-runtime@v0.6.3/pkg/internal/controller/controller.go:197\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\tk8s.io/apimachinery@v0.18.9/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\tk8s.io/apimachinery@v0.18.9/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tk8s.io/apimachinery@v0.18.9/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\tk8s.io/apimachinery@v0.18.9/pkg/util/wait/wait.go:90"}

Required change

It might be that issue is caused by the same problem as highlighted in this comment (#1648 (comment))

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
@astefanutti
Copy link
Member

Thanks a lot for the report. Would you be able to create a PR with the proposed fixes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Documentation task area/observability Logging, monitoring and tracing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants