This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 1228ce7f03ddbf3a9dabb12ae80bdca3a89461d1
Author: Nicola Ferraro <[email protected]>
AuthorDate: Thu Jun 4 18:16:11 2020 +0200

    Fix #1489: add Tracing trait
---
 addons/register_opentracing.go                   |  27 ++++
 addons/tracing/discovery/jaeger.go               |  72 +++++++++++
 addons/tracing/discovery/locator.go              |  32 +++++
 addons/tracing/tracing.go                        | 152 +++++++++++++++++++++++
 deploy/camel-catalog-1.3.0-SNAPSHOT-main.yaml    |   4 +
 deploy/camel-catalog-1.3.0-SNAPSHOT-quarkus.yaml |   4 +
 deploy/resources.go                              |  12 +-
 deploy/traits.yaml                               |  33 +++++
 docs/modules/ROOT/nav.adoc                       |   1 +
 docs/modules/traits/pages/tracing.adoc           |  54 ++++++++
 go.sum                                           |   3 +-
 pkg/apis/camel/v1/common_types.go                |   2 +
 script/gen_doc.sh                                |   2 +-
 13 files changed, 390 insertions(+), 8 deletions(-)

diff --git a/addons/register_opentracing.go b/addons/register_opentracing.go
new file mode 100644
index 0000000..d2fb82b
--- /dev/null
+++ b/addons/register_opentracing.go
@@ -0,0 +1,27 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package addons
+
+import (
+       "github.com/apache/camel-k/addons/tracing"
+       "github.com/apache/camel-k/pkg/trait"
+)
+
+func init() {
+       trait.AddToTraits(tracing.NewTracingTrait)
+}
diff --git a/addons/tracing/discovery/jaeger.go 
b/addons/tracing/discovery/jaeger.go
new file mode 100644
index 0000000..9883401
--- /dev/null
+++ b/addons/tracing/discovery/jaeger.go
@@ -0,0 +1,72 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package discovery
+
+import (
+       "fmt"
+       "sort"
+       "strings"
+
+       "github.com/apache/camel-k/pkg/client"
+       "github.com/apache/camel-k/pkg/trait"
+       "github.com/apache/camel-k/pkg/util/log"
+       metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+type JaegerTracingLocator struct {
+       allowHeadless bool
+}
+
+const (
+       jaegerPortName = "http-c-binary-trft"
+)
+
+func (loc *JaegerTracingLocator) FindEndpoint(c client.Client, l log.Logger, e 
*trait.Environment) (string, error) {
+       opts := metav1.ListOptions{
+               LabelSelector: 
"app.kubernetes.io/part-of=jaeger,app.kubernetes.io/component=service-collector",
+       }
+       lst, err := c.CoreV1().Services(e.Integration.Namespace).List(opts)
+       if err != nil {
+               return "", err
+       }
+       var candidates []string
+       for _, svc := range lst.Items {
+               if !loc.allowHeadless && strings.HasSuffix(svc.Name, 
"-headless") {
+                       continue
+               }
+
+               for _, port := range svc.Spec.Ports {
+                       if port.Name == jaegerPortName && port.Port > 0 {
+                               candidates = append(candidates, 
fmt.Sprintf("http://%s.%s.svc.cluster.local:%d/api/traces";, svc.Name, 
svc.Namespace, port.Port))
+                       }
+               }
+       }
+       sort.Strings(candidates)
+       if len(candidates) > 0 {
+               for _, endpoint := range candidates {
+                       l.Infof("Detected Jaeger endpoint at: %s", endpoint)
+               }
+               return candidates[0], nil
+       }
+       return "", nil
+}
+
+// registering the locator
+func init() {
+       TracingLocators = append(TracingLocators, &JaegerTracingLocator{}, 
&JaegerTracingLocator{allowHeadless: true})
+}
diff --git a/addons/tracing/discovery/locator.go 
b/addons/tracing/discovery/locator.go
new file mode 100644
index 0000000..609ffab
--- /dev/null
+++ b/addons/tracing/discovery/locator.go
@@ -0,0 +1,32 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package discovery
+
+import (
+       "github.com/apache/camel-k/pkg/client"
+       "github.com/apache/camel-k/pkg/trait"
+       "github.com/apache/camel-k/pkg/util/log"
+)
+
+// TracingLocators contains available tracing locators
+var TracingLocators []TracingLocator
+
+// TracingLocator is able to find the address of an available tracing endpoint
+type TracingLocator interface {
+       FindEndpoint(client.Client, log.Logger, *trait.Environment) (string, 
error)
+}
diff --git a/addons/tracing/tracing.go b/addons/tracing/tracing.go
new file mode 100644
index 0000000..9a088a5
--- /dev/null
+++ b/addons/tracing/tracing.go
@@ -0,0 +1,152 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package tracing
+
+import (
+       "github.com/apache/camel-k/addons/tracing/discovery"
+       v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+       "github.com/apache/camel-k/pkg/trait"
+       "github.com/apache/camel-k/pkg/util"
+)
+
+// The Tracing trait can be used to automatically publish tracing information 
to an
+// OpenTracing compatible collector.
+//
+// The trait is able to automatically discover the tracing endpoint available 
in the namespace (supports **Jaeger**).
+//
+// The Tracing trait is disabled by default.
+//
+// +camel-k:trait=tracing
+type tracingTrait struct {
+       trait.BaseTrait `property:",squash"`
+       // Enables automatic configuration of the trait, including automatic 
discovery of the tracing endpoint.
+       Auto *bool `property:"auto"`
+       // The name of the service that publishes tracing data (defaults to the 
integration name)
+       ServiceName string `property:"service-name"`
+       // The target endpoint of the OpenTracing service (automatically 
discovered by default)
+       Endpoint string `property:"endpoint"`
+       // The sampler type (default "const")
+       SamplerType *string `property:"sampler-type"`
+       // The sampler specific param (default "1")
+       SamplerParam *string `property:"sampler-param"`
+}
+
+const (
+       propEnabled      = "propEnabled"
+       propEndpoint     = "propEndpoint"
+       propServiceName  = "propServiceName"
+       propSamplerType  = "propSamplerType"
+       propSamplerParam = "propSamplerParam"
+)
+
+var (
+       tracingProperties = map[v1.RuntimeProvider]map[string]string{
+               v1.RuntimeProviderMain: {
+                       propEnabled:      "camel.k.customizer.tracing.enabled",
+                       propEndpoint:     
"camel.k.customizer.tracing.reporter.sender.endpoint",
+                       propServiceName:  
"camel.k.customizer.tracing.service-name",
+                       propSamplerType:  
"camel.k.customizer.tracing.sampler.type",
+                       propSamplerParam: 
"camel.k.customizer.tracing.sampler.param",
+               },
+               v1.RuntimeProviderQuarkus: {
+                       propEndpoint:     "quarkus.jaeger.endpoint",
+                       propServiceName:  "quarkus.jaeger.service-name",
+                       propSamplerType:  "quarkus.jaeger.sampler-type",
+                       propSamplerParam: "quarkus.jaeger.sampler-param",
+               },
+       }
+
+       defaultSamplerType  = "const"
+       defaultSamplerParam = "1"
+)
+
+// NewTracingTrait --
+func NewTracingTrait() trait.Trait {
+       return &tracingTrait{
+               BaseTrait: trait.NewBaseTrait("tracing", 
trait.TraitOrderBeforeControllerCreation),
+       }
+}
+
+func (t *tracingTrait) Configure(e *trait.Environment) (bool, error) {
+       if t.Enabled == nil || !*t.Enabled {
+               return false, nil
+       }
+
+       if t.Auto == nil || *t.Auto {
+               if t.Endpoint == "" {
+                       for _, locator := range discovery.TracingLocators {
+                               endpoint, err := locator.FindEndpoint(t.Client, 
t.L, e)
+                               if err != nil {
+                                       return false, err
+                               }
+                               if endpoint != "" {
+                                       t.L.Infof("Using tracing endpoint: %s", 
endpoint)
+                                       t.Endpoint = endpoint
+                                       break
+                               }
+                       }
+               }
+
+               if t.ServiceName == "" {
+                       t.ServiceName = e.Integration.Name
+               }
+
+               if t.SamplerType == nil {
+                       t.SamplerType = &defaultSamplerType
+               }
+
+               if t.SamplerParam == nil {
+                       t.SamplerParam = &defaultSamplerParam
+               }
+       }
+
+       return true, nil
+}
+
+func (t *tracingTrait) Apply(e *trait.Environment) error {
+
+       util.StringSliceUniqueAdd(&e.Integration.Status.Capabilities, 
v1.CapabilityTracing)
+
+       if e.CamelCatalog != nil {
+               provider := e.CamelCatalog.CamelCatalogSpec.Runtime.Provider
+               properties := tracingProperties[provider]
+
+               if appPropEnabled := properties[propEnabled]; appPropEnabled != 
"" {
+                       e.ApplicationProperties[appPropEnabled] = "true"
+               }
+
+               if appPropEndpoint := properties[propEndpoint]; appPropEndpoint 
!= "" && t.Endpoint != "" {
+                       e.ApplicationProperties[appPropEndpoint] = t.Endpoint
+               }
+
+               if appPropServiceName := properties[propServiceName]; 
appPropServiceName != "" && t.ServiceName != "" {
+                       e.ApplicationProperties[appPropServiceName] = 
t.ServiceName
+               }
+
+               if appPropSamplerType := properties[propSamplerType]; 
appPropSamplerType != "" && t.SamplerType != nil {
+                       e.ApplicationProperties[appPropSamplerType] = 
*t.SamplerType
+               }
+
+               if appPropSamplerParam := properties[propSamplerParam]; 
appPropSamplerParam != "" && t.SamplerParam != nil {
+                       e.ApplicationProperties[appPropSamplerParam] = 
*t.SamplerParam
+               }
+
+       }
+
+       return nil
+}
diff --git a/deploy/camel-catalog-1.3.0-SNAPSHOT-main.yaml 
b/deploy/camel-catalog-1.3.0-SNAPSHOT-main.yaml
index 8f34b3f..39a7595 100644
--- a/deploy/camel-catalog-1.3.0-SNAPSHOT-main.yaml
+++ b/deploy/camel-catalog-1.3.0-SNAPSHOT-main.yaml
@@ -60,6 +60,10 @@ spec:
         dependencies:
         - groupId: org.apache.camel
           artifactId: camel-microprofile-fault-tolerance
+      tracing:
+        dependencies:
+        - groupId: org.apache.camel.k
+          artifactId: camel-k-runtime-tracing
   artifacts:
     camel-zipfile:
       groupId: org.apache.camel
diff --git a/deploy/camel-catalog-1.3.0-SNAPSHOT-quarkus.yaml 
b/deploy/camel-catalog-1.3.0-SNAPSHOT-quarkus.yaml
index 12e1125..889a71f 100644
--- a/deploy/camel-catalog-1.3.0-SNAPSHOT-quarkus.yaml
+++ b/deploy/camel-catalog-1.3.0-SNAPSHOT-quarkus.yaml
@@ -60,6 +60,10 @@ spec:
         dependencies:
         - groupId: org.apache.camel.quarkus
           artifactId: camel-quarkus-microprofile-fault-tolerance
+      tracing:
+        dependencies:
+        - groupId: org.apache.camel.quarkus
+          artifactId: camel-quarkus-opentracing
   artifacts:
     camel-quarkus-kudu:
       groupId: org.apache.camel.quarkus
diff --git a/deploy/resources.go b/deploy/resources.go
index 3401782..7a31f7a 100644
--- a/deploy/resources.go
+++ b/deploy/resources.go
@@ -91,16 +91,16 @@ var assets = func() http.FileSystem {
                "/camel-catalog-1.3.0-SNAPSHOT-main.yaml": 
&vfsgen۰CompressedFileInfo{
                        name:             
"camel-catalog-1.3.0-SNAPSHOT-main.yaml",
                        modTime:          time.Time{},
-                       uncompressedSize: 88560,
+                       uncompressedSize: 88681,
 
-                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x7d\x5b\x77\xdb\x38\xb2\xee\x7b\x7e\x05\xd7\xe4\x65\xef\x75\x86\x35\x3d\xce\xcc\xf4\xd9\x7d\x9e\x6c\x39\x4e\xec\xd8\x8e\x3b\xf2\x24\x99\x7e\xe9\x05\x91\x90\x04\x8b\x24\x68\x00\x92\x65\xff\xfa\xb3\x70\xe1\x55\x10\x24\x12\x86\xd7\xf6\x83\x49\x11\x55\x5f\xb1\x08\x12\x97\x42\xa1\xea\x7d\x14\xbf\xde\xdf\xbb\xf7\xd1\x35\x49\x70\xc1\x71\x1a\x09\x1a\x89\x25\x8e\x4e\x4b\x94\x2c\x71\x34\xa5\x73\xf1\x84\x18\x8e\x2e\xe8\xba\x
 [...]
+                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x7d\x5b\x77\xdb\x38\xb2\xee\x7b\x7e\x05\xd7\xe4\x65\xef\x75\x86\x35\x3d\xce\xcc\xf4\xd9\x7d\x9e\x6c\x39\x4e\xec\xd8\x8e\x3b\xf2\x24\x99\x7e\xe9\x05\x91\x90\x04\x8b\x24\x68\x00\x92\x65\xff\xfa\xb3\x70\xe1\x55\x10\x24\x12\x86\xd7\xf6\x83\x49\x11\x55\x5f\xb1\x08\x12\x97\x42\xa1\xea\x7d\x14\xbf\xde\xdf\xbb\xf7\xd1\x35\x49\x70\xc1\x71\x1a\x09\x1a\x89\x25\x8e\x4e\x4b\x94\x2c\x71\x34\xa5\x73\xf1\x84\x18\x8e\x2e\xe8\xba\x
 [...]
                },
                "/camel-catalog-1.3.0-SNAPSHOT-quarkus.yaml": 
&vfsgen۰CompressedFileInfo{
                        name:             
"camel-catalog-1.3.0-SNAPSHOT-quarkus.yaml",
                        modTime:          time.Time{},
-                       uncompressedSize: 47340,
+                       uncompressedSize: 47469,
 
-                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x5d\x5f\x77\xdb\xaa\xb2\x7f\xcf\xa7\x60\x35\x2f\xe7\xac\xb5\xc5\xde\x27\xbd\xe7\x3c\xf4\x3e\x25\x69\xd3\x26\x6d\xd2\xb4\xce\xd9\xed\xde\x2f\x5d\x58\xc2\x36\xb1\x04\x0a\x20\xdb\xc9\xa7\xbf\x0b\x84\xfe\x39\xca\xe8\x4f\x90\x6f\x1e\x22\x59\x0c\xbf\x81\x01\xc1\x68\x66\x80\x63\x14\xf8\xfb\x3b\x3a\x46\x5f\x58\x48\xb9\xa2\x11\xd2\x02\xe9\x15\x45\xa7\x29\x09\x57\x14\xcd\xc4\x42\x6f\x89\xa4\xe8\x42\x64\x3c\x22\x9a\x09\x8e\x
 [...]
+                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x5d\x5f\x77\xdb\xaa\xb2\x7f\xcf\xa7\x60\x35\x2f\xe7\xac\xb5\xc5\xde\x27\xbd\xe7\x3c\xf4\x3e\x25\x69\xd3\x26\x6d\xd2\xb4\xce\xd9\xed\xde\x2f\x5d\x58\xc2\x36\xb1\x04\x0a\x20\xdb\xc9\xa7\xbf\x0b\x84\xfe\x39\xca\xe8\x4f\x90\x6f\x1e\x22\x59\x0c\xbf\x81\x01\xc1\x68\x66\x80\x63\x14\xf8\xfb\x3b\x3a\x46\x5f\x58\x48\xb9\xa2\x11\xd2\x02\xe9\x15\x45\xa7\x29\x09\x57\x14\xcd\xc4\x42\x6f\x89\xa4\xe8\x42\x64\x3c\x22\x9a\x09\x8e\x
 [...]
                },
                "/cr-example.yaml": &vfsgen۰CompressedFileInfo{
                        name:             "cr-example.yaml",
@@ -354,9 +354,9 @@ var assets = func() http.FileSystem {
                "/traits.yaml": &vfsgen۰CompressedFileInfo{
                        name:             "traits.yaml",
                        modTime:          time.Time{},
-                       uncompressedSize: 31547,
+                       uncompressedSize: 32393,
 
-                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x7d\xed\x72\x1b\x37\x96\xe8\x7f\x3f\x05\x4a\xf7\x56\x49\x54\x91\x2d\x3b\x53\x33\xc9\xe8\x5e\x6f\x4a\x6b\x3b\x33\x4a\x62\x5b\x6b\x3b\x99\xdd\xca\xa6\x86\x60\xf7\x21\x1b\x21\x1a\xe8\x01\xd0\x94\x99\xad\xad\xda\xd7\xd8\xd7\xdb\x27\xd9\x3a\x07\x1f\x8d\x26\x5b\x12\xe5\x44\xa9\x28\xf9\x61\x51\xea\x3e\x38\x38\x38\xdf\x1f\xa0\x33\x5c\x38\x7b\xfe\x64\xc6\x14\x6f\xe0\x9c\xf1\xe5\x52\x28\xe1\xb6\x4f\x18\x6b\x25\x77\x4b\x6d\x
 [...]
+                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x6d\x73\x1b\x37\xd2\xe0\x77\xff\x0a\x94\xee\xaa\x24\xaa\xc8\x91\x9d\xad\xdd\x64\x75\xe7\x4b\xe9\x6c\x67\x57\x4e\x6c\xeb\x6c\x27\x7b\x57\xb9\xd4\x12\x9c\x69\x92\x08\x31\xc0\x2c\x80\xa1\xcc\x5c\x5d\xd5\xfd\x8d\xfb\x7b\xcf\x2f\x79\xaa\x1b\x2f\x83\x21\x47\xd2\xc8\x89\x52\x51\xd5\x93\x7c\xb0\x28\xcd\x34\x1a\x8d\x7e\x7f\x01\x9d\xe1\xc2\xd9\xf3\x27\x33\xa6\x78\x0d\xe7\x8c\x2f\x97\x42\x09\xb7\x7b\xc2\x58\x23\xb9\x5b\x
 [...]
                },
                "/user-cluster-role.yaml": &vfsgen۰CompressedFileInfo{
                        name:             "user-cluster-role.yaml",
diff --git a/deploy/traits.yaml b/deploy/traits.yaml
index ca79b4f..b282184 100755
--- a/deploy/traits.yaml
+++ b/deploy/traits.yaml
@@ -774,3 +774,36 @@ traits:
   - name: description-path
     type: string
     description: The path where the Open-API specification is published 
(default `/openapi.json`)
+- name: tracing
+  platform: false
+  profiles:
+  - Kubernetes
+  - Knative
+  - OpenShift
+  description: The Tracing trait can be used to automatically publish tracing 
information
+    to anOpenTracing compatible collector.The trait is able to automatically 
discover
+    the tracing endpoint available in the namespace (supports **Jaeger**).The 
Tracing
+    trait is disabled by default.
+  properties:
+  - name: enabled
+    type: bool
+    description: Can be used to enable or disable a trait. All traits share 
this common
+      property.
+  - name: auto
+    type: bool
+    description: Enables automatic configuration of the trait, including 
automatic
+      discovery of the tracing endpoint.
+  - name: service-name
+    type: string
+    description: The name of the service that publishes tracing data (defaults 
to
+      the integration name)
+  - name: endpoint
+    type: string
+    description: The target endpoint of the OpenTracing service (automatically 
discovered
+      by default)
+  - name: sampler-type
+    type: string
+    description: The sampler type (default "const")
+  - name: sampler-param
+    type: string
+    description: The sampler specific param (default "1")
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 9754790..49c0cc6 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -46,4 +46,5 @@
 ** xref:traits:quarkus.adoc[Quarkus]
 ** xref:traits:route.adoc[Route]
 ** xref:traits:service.adoc[Service]
+** xref:traits:tracing.adoc[Tracing]
 // End of autogenerated code - DO NOT EDIT! (trait-nav)
diff --git a/docs/modules/traits/pages/tracing.adoc 
b/docs/modules/traits/pages/tracing.adoc
new file mode 100755
index 0000000..b6ece21
--- /dev/null
+++ b/docs/modules/traits/pages/tracing.adoc
@@ -0,0 +1,54 @@
+= Tracing Trait
+
+// Start of autogenerated code - DO NOT EDIT! (description)
+The Tracing trait can be used to automatically publish tracing information to 
an
+OpenTracing compatible collector.
+
+The trait is able to automatically discover the tracing endpoint available in 
the namespace (supports **Jaeger**).
+
+The Tracing trait is disabled by default.
+
+
+This trait is available in the following profiles: **Kubernetes, Knative, 
OpenShift**.
+
+// End of autogenerated code - DO NOT EDIT! (description)
+// Start of autogenerated code - DO NOT EDIT! (configuration)
+== Configuration
+
+Trait properties can be specified when running any integration with the CLI:
+```
+kamel run --trait tracing.[key]=[value] --trait tracing.[key2]=[value2] 
integration.groovy
+```
+The following configuration options are available:
+
+[cols="2,1,5a"]
+|===
+|Property | Type | Description
+
+| tracing.enabled
+| bool
+| Can be used to enable or disable a trait. All traits share this common 
property.
+
+| tracing.auto
+| bool
+| Enables automatic configuration of the trait, including automatic discovery 
of the tracing endpoint.
+
+| tracing.service-name
+| string
+| The name of the service that publishes tracing data (defaults to the 
integration name)
+
+| tracing.endpoint
+| string
+| The target endpoint of the OpenTracing service (automatically discovered by 
default)
+
+| tracing.sampler-type
+| string
+| The sampler type (default "const")
+
+| tracing.sampler-param
+| string
+| The sampler specific param (default "1")
+
+|===
+
+// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/go.sum b/go.sum
index ecc5510..b99724b 100644
--- a/go.sum
+++ b/go.sum
@@ -724,7 +724,7 @@ github.com/operator-framework/operator-lifecycle-manager 
v0.0.0-20200321030439-5
 github.com/operator-framework/operator-registry v1.5.3/go.mod 
h1:agrQlkWOo1q8U1SAaLSS2WQ+Z9vswNT2M2HFib9iuLY=
 github.com/operator-framework/operator-registry v1.6.1/go.mod 
h1:sx4wWMiZtYhlUiaKscg3QQUPPM/c1bkrAs4n4KipDb4=
 github.com/operator-framework/operator-registry 
v1.6.2-0.20200330184612-11867930adb5/go.mod 
h1:SHff373z8asEkPo6aWpN0qId4Y/feQTjZxRF8PRhti8=
-github.com/operator-framework/operator-sdk v0.17.1 
h1:ESV2s2oQsZPQiQ8VfC8S5DzEnO/azXF82Fj++5qpAkw=
+github.com/operator-framework/operator-sdk v0.17.1 
h1:Y/QS7FrEQ0KrURc0NYsbD9n6JhR2B4REs2Ki39RBDno=
 github.com/operator-framework/operator-sdk v0.17.1/go.mod 
h1:wmYi08aoUmtgfoUamURmssI4dkdFGNtSI1Egj+ZfBnk=
 github.com/otiai10/copy v1.0.1/go.mod 
h1:8bMCJrAqOtN/d9oyh5HR7HhLQMvcGMpGdwRDYsfOCHc=
 github.com/otiai10/copy v1.0.2/go.mod 
h1:c7RpqBkwMom4bYTSkLSym4VSJz/XtncWRAj/J4PEIMY=
@@ -1312,6 +1312,7 @@ k8s.io/cli-runtime v0.17.6/go.mod 
h1:CHzZyoNkNFdB3Ot+KcDD26Hd1GCsc84RenZmr8DKnVs
 k8s.io/client-go v0.17.6 h1:W/JkbAcIZUPb9vENRTC75ymjQQO3qEJAZyYhOIEOifM=
 k8s.io/client-go v0.17.6/go.mod h1:tX5eAbQR/Kbqv+5R93rzHQoyRnPjjW2mm9i0lXnW218=
 k8s.io/cloud-provider v0.17.6/go.mod 
h1:8A676iHjWLrjc72gYOayHoPbPGsHsqmWyxayArgX2r8=
+k8s.io/code-generator v0.17.6 h1:2e0zgYsJmkc66HHEq7MoG1HgCEDCYLT08Y4VBcdzTkk=
 k8s.io/code-generator v0.17.6/go.mod 
h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M=
 k8s.io/component-base v0.17.6/go.mod 
h1:jgRLWl0B0rOzFNtxQ9E4BphPmDqoMafujdau6AdG2Xo=
 k8s.io/csi-translation-lib v0.17.6/go.mod 
h1:ZGRd0pXA4XazjuOjjo+1mQeCp0MzOwL9r9xXz1z8mhY=
diff --git a/pkg/apis/camel/v1/common_types.go 
b/pkg/apis/camel/v1/common_types.go
index 36be391..2dcdcc1 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -118,6 +118,8 @@ const (
        CapabilityPlatformHTTP = "platform-http"
        // CapabilityCircuitBreaker
        CapabilityCircuitBreaker = "circuit-breaker"
+       // CapabilityTracing --
+       CapabilityTracing = "tracing"
 )
 
 // ResourceCondition is a common type for all conditions
diff --git a/script/gen_doc.sh b/script/gen_doc.sh
index 7f16901..95ad4c9 100755
--- a/script/gen_doc.sh
+++ b/script/gen_doc.sh
@@ -21,4 +21,4 @@ rootdir=$location/..
 echo "Generating traits documentation..."
 
 cd $rootdir
-go run ./cmd/util/doc-gen --input-dirs ./pkg/trait --input-dirs 
./addons/master --input-dirs ./addons/threescale
+go run ./cmd/util/doc-gen --input-dirs ./pkg/trait --input-dirs 
./addons/master --input-dirs ./addons/threescale --input-dirs ./addons/tracing

Reply via email to