Skip to content

Commit

Permalink
Merge branch 'main' into reduce-fp-java-inspection
Browse files Browse the repository at this point in the history
  • Loading branch information
AvihuHenya authored Feb 11, 2025
2 parents e50375c + 4683ffe commit 5bb0775
Show file tree
Hide file tree
Showing 375 changed files with 8,148 additions and 13,205 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: lycheeverse/lychee-action@v2.2.0
- uses: lycheeverse/lychee-action@v2.3.0
with:
args: >-
-v -n "*.md" "**/*.md" "**/*.mdx"
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/publish-modules-artifactregistry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Publish Images to Artifact Registry

on:
push:
tags:
- "v*"

jobs:

publish-docker-images:
strategy:
matrix:
dockerfile: ['Dockerfile', 'Dockerfile.rhel']
service: ['autoscaler', 'scheduler', 'instrumentor', 'collector', 'odiglet', 'ui']
include:
- service: autoscaler
runner: ubuntu-latest
summary: "Autoscaler for Odigos"
description: "Autoscaler manages the installation of Odigos components."
- service: scheduler
runner: ubuntu-latest
summary: "Scheduler for Odigos"
description: "Scheduler manages the installation of OpenTelemetry Collectors with Odigos."
- service: instrumentor
runner: ubuntu-latest
summary: "Instrumentor for Odigos"
description: "Instrumentor manages auto-instrumentation for workloads with Odigos."
- service: collector
runner: large-runner
summary: "Odigos Collector"
description: "The Odigos build of the OpenTelemetry Collector."
- service: odiglet
runner: ubuntu-latest
summary: "Odiglet for Odigos"
description: "Odiglet is the core component of Odigos managing auto-instrumentation. This image requires a root user to load and manage eBPF programs."
- service: ui
runner: ubuntu-latest
summary: "UI for Odigos"
description: "UI provides the frontend webapp for managing an Odigos installation."
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract Tag
id: extract_tag
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- id: gcp-auth
name: Authenticate with Google Cloud
uses: google-github-actions/auth@v0
with:
token_format: access_token
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
access_token_lifetime: 1200s

- name: Login to Artifact Registry
uses: docker/login-action@v1
with:
registry: us-central1-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.gcp-auth.outputs.access_token }}

- name: Build and Push Docker Image for ${{ matrix.service }}
uses: docker/build-push-action@v6
with:
push: true
tags: us-central1-docker.pkg.dev/odigos-cloud/components/odigos-${{ matrix.service }}${{ matrix.dockerfile == 'Dockerfile.rhel' && '-ubi9' || '' }}:${{ steps.extract_tag.outputs.tag }}
build-args: |
SERVICE_NAME=${{ matrix.service }}
ODIGOS_VERSION=${{ steps.extract_tag.outputs.tag }}
RELEASE=${{ steps.extract_tag.outputs.tag }}
VERSION=${{ steps.extract_tag.outputs.tag }}
SUMMARY=${{ matrix.summary }}
DESCRIPTION=${{ matrix.description }}
platforms: linux/amd64,linux/arm64
file: >-
${{ matrix.service == 'odiglet' && format('odiglet/{0}', matrix.dockerfile) ||
matrix.service == 'collector' && format('collector/{0}', matrix.dockerfile) ||
matrix.service == 'ui' && format('frontend/{0}', matrix.dockerfile) ||
matrix.dockerfile }}
context: >-
${{
(matrix.service == 'collector' && 'collector') ||
'.'
}}
59 changes: 22 additions & 37 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Contributing Guide

* [Welcome](#welcome)
* [Ways to Contribute](#ways-to-contribute)
* [Find an Issue](#find-an-issue)
* [Issue Guidelines](#issue-guidelines)
* [Pull Request Guidelines](#pull-request-guidelines)
* [Communication](#communication)
* [Code Review Process](#code-review-process)
* [Testing Requirements](#testing-requirements)
* [Code of Conduct](#code-of-conduct)
* [License](#license)
* [Local Development](#local-development)
- [Welcome](#welcome)
- [Ways to Contribute](#ways-to-contribute)
- [Find an Issue](#find-an-issue)
- [Issue Guidelines](#issue-guidelines)
- [Pull Request Guidelines](#pull-request-guidelines)
- [Communication](#communication)
- [Code Review Process](#code-review-process)
- [Testing Requirements](#testing-requirements)
- [Code of Conduct](#code-of-conduct)
- [License](#license)
- [Local Development](#local-development)
- [Run Odigos CLI from Code](#run-odigos-cli-from-code)
- [How to Develop Odigos Locally](#how-to-develop-odigos-locally)
- [How to Build and Run Odigos Frontend Locally](#how-to-build-and-run-odigos-frontend-locally)
* [Odiglet](#odiglet)
- [Odiglet](#odiglet)
- [Builder Base Image](#builder-base-image)
- [Remote Debugging](#remote-debugging)
* [Instrumentor](#instrumentor)
- [Instrumentor](#instrumentor)
- [Debugging](#debugging)

Welcome! We are glad that you want to contribute to our project! 💖
Expand Down Expand Up @@ -120,11 +120,11 @@ First, follow the [Quickstart Guide](https://docs.odigos.io/quickstart/introduct

Make sure you are able to:

- [X] run Odigos CLI in your terminal.
- [X] open the demo application UI in your browser to interact with it.
- [X] install odigos in your development cluster with `odigos install`.
- [X] open Odigos UI in your browser to interact with it.
- [X] see telemetry data that odigos generates, for example traces in jaeger.
- [x] run Odigos CLI in your terminal.
- [x] open the demo application UI in your browser to interact with it.
- [x] install odigos in your development cluster with `odigos install`.
- [x] open Odigos UI in your browser to interact with it.
- [x] see telemetry data that odigos generates, for example traces in jaeger.

After you have a working odigos setup, you can start making changes to the code and test them locally.

Expand Down Expand Up @@ -162,9 +162,9 @@ make deploy
- Deploy a specific service by running one of the following commands:

```bash
make deploy-odiglet
make deploy-autoscaler
make deploy-collector
make deploy-odiglet
make deploy-autoscaler
make deploy-collector
make deploy-scheduler
make deploy-instrumentor
make deploy-ui
Expand All @@ -184,22 +184,7 @@ See the [Odigos docs](https://docs.odigos.io/intro) for the full steps on debugg

### How to Build and run Odigos Frontend Locally

Build the frontend

```bash
cd frontend/webapp
yarn install
yarn build
yarn dev
cd ../.. # back to root of the project for next steps
```

Then run the web server

```bash
cd frontend
go build -o odigos-backend && ./odigos-backend --port 8085 --debug --address 0.0.0.0
```
See the [Frontend README.md](https://github.com/odigos-io/odigos/blob/main/frontend/webapp/README.md) for the full steps.

## Odiglet

Expand Down
26 changes: 24 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ update-dep/%:
cd $(DIR) && go get $(MODULE)@$(VERSION)

GO_AUTO_VERSION=v0.19.0-alpha
UNSTABLE_COLLECTOR_VERSION=v0.118.0
STABLE_COLLECTOR_VERSION=v1.24.0
UNSTABLE_COLLECTOR_VERSION=v0.119.0
STABLE_COLLECTOR_VERSION=v1.25.0
STABLE_OTEL_GO_VERSION=v1.34.0
UNSTABLE_OTEL_GO_VERSION=v0.59.0

Expand Down Expand Up @@ -337,6 +337,28 @@ dev-tests-setup: dev-tests-kind-cluster cli-build build-images load-to-kind
dev-tests-setup-no-build: TAG := e2e-test
dev-tests-setup-no-build: dev-tests-kind-cluster load-to-kind

# When you run an e2e test locally, and want a grafana instance to troubleshoot the results
# run this target to start grafana, then run dev-tests-grafana-port-forward to access it.
.PHONY: dev-tests-grafana
dev-tests-grafana:
@echo "Starting Grafana for troubleshooting e2e tests"
helm install -n traces grafana grafana/grafana \
--set "env.GF_AUTH_ANONYMOUS_ENABLED=true" \
--set "env.GF_AUTH_ANONYMOUS_ORG_ROLE=Admin" \
--set "datasources.datasources\.yaml.apiVersion=1" \
--set "datasources.datasources\.yaml.datasources[0].name=Tempo" \
--set "datasources.datasources\.yaml.datasources[0].type=tempo" \
--set "datasources.datasources\.yaml.datasources[0].url=http://e2e-tests-tempo:3100" \
--set "datasources.datasources\.yaml.datasources[0].access=proxy" \
--set "datasources.datasources\.yaml.datasources[0].isDefault=true"

# For e2e local tests, run this target to port forward the Grafana instance to your local browser
.PHONY: dev-tests-grafana-port-forward
dev-tests-grafana-port-forward:
@echo "Port forwarding Grafana for troubleshooting e2e tests"
@echo "Visit http://localhost:3080/explore to access Grafana"
kubectl port-forward -n traces svc/grafana 3080:80

# Use this for debug to add a destination which only prints samples of telemetry items to the cluster gateway collector logs
.PHONY: dev-debug-destination
dev-debug-destination:
Expand Down
2 changes: 1 addition & 1 deletion agents/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# index_url = 'http://host.docker.internal:8081/packages/odigos_opentelemetry_python-0.1.1-py3-none-any.whl'

install_requires = [
f"odigos-opentelemetry-python @ {index_url}" if index_url else "odigos-opentelemetry-python==1.0.25"
f"odigos-opentelemetry-python @ {index_url}" if index_url else "odigos-opentelemetry-python==1.0.26"
]

setup(
Expand Down
115 changes: 115 additions & 0 deletions api/actions/v1alpha1/k8sattributes_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
Copyright 2022.
Licensed 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 v1alpha1

import (
"github.com/odigos-io/odigos/common"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type K8sLabelAttribute struct {
// The label name to be extracted from the pod.
// e.g. "app.kubernetes.io/name"
// +kubebuilder:validation:Required
LabelKey string `json:"labelKey"`
// The attribute key to be used for the resource attribute created from the label.
// e.g. "app.kubernetes.name"
// +kubebuilder:validation:Required
AttributeKey string `json:"attributeKey"`
}

type K8sAnnotationAttribute struct {
// The label name to be extracted from the pod.
// e.g. "kubectl.kubernetes.io/restartedAt"
// +kubebuilder:validation:Required
AnnotationKey string `json:"annotationKey"`
// The attribute key to be used for the resource attribute created from the label.
// e.g. "kubectl.kubernetes.restartedAte"
// +kubebuilder:validation:Required
AttributeKey string `json:"attributeKey"`
}

type K8sAttributesSpec struct {
ActionName string `json:"actionName,omitempty"`
Notes string `json:"notes,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Signals []common.ObservabilitySignal `json:"signals"`

// Collect the following container related attributes:
// k8s.container.name
// container.id
// container.image.name
// container.image.tag
CollectContainerAttributes bool `json:"collectContainerAttributes,omitempty"`

// Collect the following workload UID attributes:
// k8s.deployment.uid
// k8s.daemonset.uid
// k8s.statefulset.uid
CollectWorkloadUID bool `json:"collectWorkloadUID,omitempty"`

// Collect the k8s.cluster.uid attribute, which is set to the uid of the namespace "kube-system"
CollectClusterUID bool `json:"collectClusterUID,omitempty"`

// list of labels to be extracted from the pod, and the attribute key to be used for the resource attribute created from each label.
// +optional
LabelsAttributes []K8sLabelAttribute `json:"labelsAttributes,omitempty"`

// list of annotations to be extracted from the pod, and the attribute key to be used for the resource attribute created from each annotation.
// +optional
AnnotationsAttributes []K8sAnnotationAttribute `json:"annotationsAttributes,omitempty"`
}

// K8sAttributesStatus defines the observed state of K8sAttributes action
type K8sAttributesStatus struct {
// Represents the observations of a k8sattributes' current state.
// Known .status.conditions.type are: "Available", "Progressing"
// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}

//+genclient
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:path=k8sattributesresolvers,scope=Namespaced
//+kubebuilder:metadata:labels=metadata.labels.odigos.io/config=1
//+kubebuilder:metadata:labels=metadata.labels.odigos.io/system-object=true

// K8sAttributesResolver allows adding an action to collect k8s attributes.
type K8sAttributesResolver struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec K8sAttributesSpec `json:"spec,omitempty"`
Status K8sAttributesStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// K8sAttributesResolverList contains a list of K8sAttributes
type K8sAttributesResolverList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []K8sAttributesResolver `json:"items"`
}

func init() {
SchemeBuilder.Register(&K8sAttributesResolver{}, &K8sAttributesResolverList{})
}
Loading

0 comments on commit 5bb0775

Please sign in to comment.