-
Notifications
You must be signed in to change notification settings - Fork 250
CORE-680: Add OBI distro #4468
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
CORE-680: Add OBI distro #4468
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,6 +130,7 @@ spec: | |
| - postgres | ||
| - unknown | ||
| - ignored | ||
| - '*' | ||
| type: string | ||
| libCType: | ||
| enum: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ package common | |
|
|
||
| import ( | ||
| "fmt" | ||
| "strings" | ||
|
|
||
| "github.com/hashicorp/go-version" | ||
| semconv "go.opentelemetry.io/otel/semconv/v1.26.0" | ||
|
|
@@ -12,10 +13,12 @@ type ProgramLanguageDetails struct { | |
| RuntimeVersion string | ||
| } | ||
|
|
||
| // +kubebuilder:validation:Enum=java;python;go;dotnet;javascript;php;ruby;rust;cplusplus;mysql;nginx;redis;postgres;unknown;ignored | ||
| // +kubebuilder:validation:Enum=java;python;go;dotnet;javascript;php;ruby;rust;cplusplus;mysql;nginx;redis;postgres;unknown;ignored;* | ||
| type ProgrammingLanguage string | ||
|
|
||
| const ( | ||
| // ProgrammingLanguageWildcard means the distribution accepts any container programming language (see distro YAML). | ||
| ProgrammingLanguageWildcard ProgrammingLanguage = "*" | ||
| JavaProgrammingLanguage ProgrammingLanguage = "java" | ||
| PythonProgrammingLanguage ProgrammingLanguage = "python" | ||
| GoProgrammingLanguage ProgrammingLanguage = "go" | ||
|
|
@@ -38,6 +41,11 @@ const ( | |
| UnknownProgrammingLanguage ProgrammingLanguage = "unknown" | ||
| ) | ||
|
|
||
| // IsProgrammingLanguageWildcard reports whether lang is the distro wildcard meaning "any language". | ||
| func IsProgrammingLanguageWildcard(lang ProgrammingLanguage) bool { | ||
| return strings.TrimSpace(string(lang)) == string(ProgrammingLanguageWildcard) | ||
| } | ||
|
Comment on lines
+44
to
+47
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for other languages we compare directly with |
||
|
|
||
| // MapOdigosToSemConv maps odigos programming language to OpenTelemetry semantic conventions | ||
| // It is supported only for the languages that are supported by OpenTelemetry [not for mysql, nginx, etc.] | ||
| func MapOdigosToSemConv(odigosPrograminglang ProgrammingLanguage) string { | ||
|
|
||
|
damemi marked this conversation as resolved.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we also have also, since the mechanism is a bit different, I wonder if this can cause confusion for users
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so, I named this literally after OBI "opentelemetry-ebpf-instrumentation" the project itself for clarity https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| apiVersion: internal.odigos.io/v1beta1 | ||
| kind: OtelDistribution | ||
| metadata: | ||
| name: opentelemetry-ebpf-instrumentation | ||
| spec: | ||
| name: opentelemetry-ebpf-instrumentation | ||
| language: '*' | ||
| isEbpf: true | ||
| runtimeEnvironments: | ||
| - name: multi-runtime | ||
| supportedVersions: '*' | ||
|
damemi marked this conversation as resolved.
|
||
| displayName: OpenTelemetry eBPF Instrumentation (OBI) | ||
| description: | | ||
| Language-agnostic eBPF-based instrumentation using the OpenTelemetry eBPF Instrumentation (OBI) SDK. | ||
| Supports any language without code changes. Not enabled by default. | ||
| runtimeAgent: | ||
| noRestartRequired: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| title: "OpenTelemetry eBPF Instrumentation (OBI)" | ||
| description: "OBI is OpenTelemetry’s eBPF-based auto-instrumentation." | ||
| sidebarTitle: "OBI" | ||
| icon: "telescope" | ||
| --- | ||
|
|
||
| import Content from "/snippets/oss/instrumentations/obi.mdx"; | ||
|
|
||
| <Content /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| Odigos can run **[OpenTelemetry eBPF Instrumentation (OBI)](https://opentelemetry.io/docs/zero-code/obi)** for workloads where the `opentelemetry-ebpf-instrumentation` distro is selected. | ||
|
|
||
| <CardGroup cols={2}> | ||
| <Card | ||
| title="OpenTelemetry OBI" | ||
| icon="telescope" | ||
| href="https://opentelemetry.io/docs/zero-code/obi" | ||
| > | ||
| Upstream concepts, requirements, and capabilities. | ||
| </Card> | ||
| <Card | ||
| title="OBI on GitHub" | ||
| icon="code" | ||
| href="https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation" | ||
| > | ||
| Source, releases, and issues. | ||
| </Card> | ||
| </CardGroup> | ||
|
|
||
| ## OBI Support | ||
|
|
||
| OBI can be enabled by selecting it as a container override for specific workloads. If editing a [Source object](/oss/pipeline/sources/introduction), | ||
| this is done through the `containerOverrides` field. For example: | ||
|
|
||
| ```yaml | ||
| apiVersion: odigos.io/v1alpha1 | ||
| kind: Source | ||
| metadata: | ||
| name: my-workload | ||
| namespace: default | ||
| spec: | ||
| workload: | ||
| kind: DaemonSet | ||
| name: sample-app | ||
| namespace: default | ||
| containerOverrides: | ||
| - containerName: foo | ||
| otelDistroName: opentelemetry-ebpf-instrumentation | ||
| ``` | ||
|
|
||
| In this case, `containerName` is the name of the container to instrument in this workload, and the required | ||
| `otelDistroName` is **`opentelemetry-ebpf-instrumentation`**. | ||
|
|
||
| Or through the **Container Overrides** field in the UI. | ||
|
|
||
| ### Limitations | ||
|
|
||
| OBI's instrumentation is based on HTTP header propagation. For encrypted traffic, context propagation will not work unless both | ||
| workloads (client and server) are instrumented with OBI as explained in [the official OBI docs](https://opentelemetry.io/docs/zero-code/obi/distributed-traces/#context-propagation-at-network-level). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,6 +130,7 @@ spec: | |
| - postgres | ||
| - unknown | ||
| - ignored | ||
| - '*' | ||
| type: string | ||
| libCType: | ||
| enum: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ rules: | |
| - '' | ||
| resources: | ||
| - pods | ||
| - services | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this required?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OBI uses service discovery out of the box, not sure if it's specifically for trace decoration or just cluster wide discovery. I'll check if it's configurable, otherwise the odiglet logs a bunch of permission errors from OBI |
||
| verbs: | ||
| - get | ||
| - list | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,11 @@ func resolveDistroByOverride(overwriteDistroName string, distroGetter *distros.G | |
| } | ||
| } | ||
|
|
||
| // Wildcard-language distros skip container language match when explicitly selected. | ||
| if common.IsProgrammingLanguageWildcard(distro.Language) { | ||
| return distro, nil | ||
| } | ||
|
|
||
| // verify the distro matches the language, since it might be overridden by the container override. | ||
| if distro.Language != containerLanguage { | ||
| return nil, &odigosv1.AgentDisabledInfo{ | ||
|
|
@@ -79,6 +84,9 @@ func CalculateDefaultDistroPerLanguage(defaultDistros map[common.ProgrammingLang | |
| if distro == nil { | ||
| continue | ||
| } | ||
| if common.IsProgrammingLanguageWildcard(distro.Language) { | ||
| continue | ||
| } | ||
|
Comment on lines
+87
to
+89
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could be nice to add support for this in the rule someday in the duture |
||
|
|
||
| lang := distro.Language | ||
| distrosPerLanguage[lang] = distroName | ||
|
|
@@ -133,8 +141,9 @@ func ResolveDistroForContainer( | |
| return nil, disabledInfo | ||
| } | ||
|
|
||
| // check if the runtime version is in supported range if it is provided | ||
| if runtimeDetails.RuntimeVersion != "" && len(d.RuntimeEnvironments) == 1 { | ||
| // check if the runtime version is in supported range if it is provided. | ||
| // Wildcard-language distros (e.g. OBI) skip semver checks; supportedVersions may be '*'. | ||
| if runtimeDetails.RuntimeVersion != "" && len(d.RuntimeEnvironments) == 1 && !common.IsProgrammingLanguageWildcard(d.Language) { | ||
| constraint, err := version.NewConstraint(d.RuntimeEnvironments[0].SupportedVersions) | ||
| if err != nil { | ||
| return nil, &odigosv1.AgentDisabledInfo{ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.