Skip to content
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

docs: add architectural overview for VM Agent #1460

Merged
merged 5 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions docs/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ is responsible for:

## High Level Architecture

These tasks are performed by 4 microservices:
These tasks are performed by following components:

- Instrumentor
- Odiglet
- Autoscaler
- Scheduler
- UI

The different microservices communicate via Kubernetes API server (see
The different components communicate via Kubernetes API server (see
[Custom Resources](/custom-resources) for more details).

The following diagram shows the architecture of the Odigos observability system.
Expand All @@ -40,37 +41,33 @@ The following diagram shows the architecture of the Odigos observability system.

## Instrumentor

The instrumentor microservice is responsible for automatic detection of
applications in the cluster and instrumentation of them. Automatic
Instrumentor is responsible for automatic detection of
applications in the cluster and providing necessary setup for Odiglet to instrument them. Automatic
instrumentation is done according to the applications selected by the user in
the UI. The instrumentor may change the arguments passed to the instrumentation
the UI. Instrumentor may change the arguments passed to the instrumentation
SDK to reflect the following changes:

- A configuration change made by the user (for example changing the sampling
rate in the UI)
- Rescheduling done by the scheduler (when the collectors pipeline changes)

### Language Detection
### Odiglet

Odiglet does the heavy lifting of instrumenting the running application.

A key part of being able to automatically instrument every new application is to
be able to detect the language of the application. After the language is
detected Odigos will perform automatic instrumentation according to the
language. For runtime languages Odigos uses the appropriate OpenTelemetry
instrumentation. For compiled languages Odigos uses eBPF instrumentation. In
order to detect the language of the application Odigos deploys a lang detection
pod that analyzes one of the target application instances. This pod is deployed
on the same node as the target instance and is able to look into the target pod
filesystem.

The lang detection pod uses the following heuristics in order to detect the
language of the application:
instrumentation. For compiled languages Odigos uses eBPF instrumentation.

- process name
- environment variables
- dynamically loaded libraries
Following heuristics are used to detect the language and the suitable instrumentations
for the application:

The lang detection pod reports the detected language by leveraging the
`TerminationMessagePath` field of the Pod resource.
- process name,
- the command,
- environment variables,
- dynamically loaded libraries.

## Autoscaler

Expand All @@ -84,8 +81,8 @@ Deployment of collectors is done in two scenarios:

## Scheduler

The scheduler service assigns applications discovered by the instrumentor to the
collectors pipeline create by the autoscaler.
Scheduler service assigns applications discovered by Instrumentor to the
collectors pipeline created by the autoscaler.

## UI

Expand Down
1 change: 1 addition & 0 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
"group": "VM Agent",
"pages": [
"vmagent/overview",
"vmagent/architecture",
{
"group": "Quickstart",
"pages": [
Expand Down
34 changes: 34 additions & 0 deletions docs/vmagent/architecture.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: "Architecture"
sidebarTitle: "Architecture"
---

VM Agent is mainly built on the same components as Odigos' k8s distribution. See [the architectural overview](/architecture) for it to get an overview of what those components are and how they interact.

However, since the environment is very different from k8s, there are significant differences as well. This document tries to list the most important ones.

VM Agent constists of following components:

- SystemD manager,
- Instrumentor,
- eBPF directors,
- Configuration manager.

## SystemD manager

SystemD manager watches changes to service files, service runtime statuses and provides necessary information for Instrumentor.

## Instrumentor

Instrumentor updates the service files when required and automatically instruments configured services.

## eBPF directors

The directors are each responsible for a set language. These are the components that do the last mile of instrumentation injecting tracing and exporting telemetry to the local collector.

## Configuration manager

Configuration managers watch configuration changes and reconfigure instrumentations or the collector whenever necessary. The configuration for VM Agent is split between two files:

- `/etc/odigos-vmagent/service.yaml`: Odigos Pro token configuration;
- `/etc/odigos-vmagent/agent.yaml`: Agent configuration specifying the collector pipeline(processors and destinations), and instrumentation configuration - SystemD services to instrument and to ignore.
Loading