Skip to content

Commit

Permalink
feat(trait): Move addon Telemetry to traits
Browse files Browse the repository at this point in the history
  • Loading branch information
gansheer committed Sep 4, 2024
1 parent fff69fd commit 50b8b04
Show file tree
Hide file tree
Showing 23 changed files with 724 additions and 121 deletions.
5 changes: 0 additions & 5 deletions addons/addons_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"testing"

"github.com/apache/camel-k/v2/addons/master"
"github.com/apache/camel-k/v2/addons/telemetry"
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
"github.com/apache/camel-k/v2/pkg/trait"

Expand Down Expand Up @@ -61,8 +60,4 @@ func TestTraitConfiguration(t *testing.T) {
assert.Equal(t, "test-label", *master.LabelKey)
assert.Equal(t, "test-value", *master.LabelValue)

require.NotNil(t, c.GetTrait("telemetry"))
telemetry, ok := c.GetTrait("telemetry").(*telemetry.TestTelemetryTrait)
require.True(t, ok)
assert.True(t, *telemetry.Enabled)
}
27 changes: 0 additions & 27 deletions addons/register_telemetry.go

This file was deleted.

21 changes: 0 additions & 21 deletions addons/telemetry/test_support.go

This file was deleted.

1 change: 0 additions & 1 deletion addons/telemetry/zz_desc_generated.go

This file was deleted.

1 change: 0 additions & 1 deletion addons/telemetry/zz_generated_doc.go

This file was deleted.

81 changes: 81 additions & 0 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6057,6 +6057,13 @@ The configuration of Service trait
The configuration of Service Binding trait
|`telemetry` +
*xref:#_camel_apache_org_v1_trait_TelemetryTrait[TelemetryTrait]*
|
The configuration of Telemetry trait
|`toleration` +
*xref:#_camel_apache_org_v1_trait_TolerationTrait[TolerationTrait]*
|
Expand Down Expand Up @@ -8774,6 +8781,79 @@ The type of service to be used, either 'ClusterIP', 'NodePort' or 'LoadBalancer'
[#_camel_apache_org_v1_trait_TelemetryTrait]
=== TelemetryTrait
*Appears on:*
* <<#_camel_apache_org_v1_Traits, Traits>>
The Telemetry trait can be used to automatically publish tracing information to an OTLP compatible collector.
The trait is able to automatically discover the telemetry OTLP endpoint available in the namespace (supports **Jaerger** in version 1.35+).
The Telemetry trait is disabled by default.
WARNING: The Telemetry trait can't be enabled at the same time as the Tracing trait.
[cols="2,2a",options="header"]
|===
|Field
|Description
|`Trait` +
*xref:#_camel_apache_org_v1_trait_Trait[Trait]*
|(Members of `Trait` are embedded into this type.)
|`auto` +
bool
|
Enables automatic configuration of the trait, including automatic discovery of the telemetry endpoint.
|`serviceName` +
string
|
The name of the service that publishes telemetry data (defaults to the integration name)
|`endpoint` +
string
|
The target endpoint of the Telemetry service (automatically discovered by default)
|`sampler` +
string
|
The sampler of the telemetry used for tracing (default "on")
|`sampler-ratio` +
string
|
The sampler ratio of the telemetry used for tracing
|`sampler-parent-based` +
bool
|
The sampler of the telemetry used for tracing is parent based (default "true")
|===
[#_camel_apache_org_v1_trait_TolerationTrait]
=== TolerationTrait
Expand Down Expand Up @@ -8843,6 +8923,7 @@ The list of taints to tolerate, in the form `Key[=Value]:Effect[:Seconds]`
* <<#_camel_apache_org_v1_trait_RouteTrait, RouteTrait>>
* <<#_camel_apache_org_v1_trait_ServiceBindingTrait, ServiceBindingTrait>>
* <<#_camel_apache_org_v1_trait_ServiceTrait, ServiceTrait>>
* <<#_camel_apache_org_v1_trait_TelemetryTrait, TelemetryTrait>>
* <<#_camel_apache_org_v1_trait_TolerationTrait, TolerationTrait>>
Trait is the base type for all traits. It could be disabled by the user.
Expand Down
Loading

0 comments on commit 50b8b04

Please sign in to comment.