Skip to content

Commit

Permalink
feat: add odigos version resource attribute to own telemetry (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
blumamir authored Oct 19, 2023
1 parent c79f5fa commit 3319cab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cli/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ type ResourceCreationFunc func(ctx context.Context, cmd *cobra.Command, client *
var installCmd = &cobra.Command{
Use: "install",
Short: "Install Odigos",
Long: `Install Odigos in your cluster. This command will install the Odigos CRDs, the Odigos Instrumentor, Scheduler, Autoscaler and Odiglet.`,
Long: `Install Odigos in your kubernetes cluster.
This command will install k8s components that will auto-instrument your applications with OpenTelemetry and send traces, metrics and logs to any telemetry backend`,
Run: func(cmd *cobra.Command, args []string) {

client, err := kube.CreateClient(cmd)
Expand Down Expand Up @@ -317,7 +318,7 @@ func createOwnTelemetryPipeline(ctx context.Context, cmd *cobra.Command, client
return errors.New("odigos cloud api key is required for odigos own telemetry")
}

_, err := client.CoreV1().ConfigMaps(ns).Create(ctx, resources.NewOwnTelemetryConfigMapOtlpGrpc(ns), metav1.CreateOptions{})
_, err := client.CoreV1().ConfigMaps(ns).Create(ctx, resources.NewOwnTelemetryConfigMapOtlpGrpc(ns, versionFlag), metav1.CreateOptions{})
if err != nil {
return err
}
Expand Down
4 changes: 3 additions & 1 deletion cli/cmd/resources/owntelemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewOwnTelemetryConfigMapDisabled() *corev1.ConfigMap {
}

// for odigos cloud which process own telemetry
func NewOwnTelemetryConfigMapOtlpGrpc(ns string) *corev1.ConfigMap {
func NewOwnTelemetryConfigMapOtlpGrpc(ns string, odigosVersion string) *corev1.ConfigMap {
return &corev1.ConfigMap{
TypeMeta: v1.TypeMeta{
Kind: "ConfigMap",
Expand All @@ -60,6 +60,8 @@ func NewOwnTelemetryConfigMapOtlpGrpc(ns string) *corev1.ConfigMap {
"OTEL_EXPORTER_OTLP_INSECURE": "true",
// the http:// scheme is not actually used, it how the exporter is expecting the value with grpc
"OTEL_EXPORTER_OTLP_ENDPOINT": fmt.Sprintf("http://%s.%s:4317", ownTelemetryCollectorServiceName, ns),
// resource attributes
"OTEL_RESOURCE_ATTRIBUTES": fmt.Sprintf("odigos.version=%s", odigosVersion),
},
}
}
Expand Down

0 comments on commit 3319cab

Please sign in to comment.