Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
BenElferink committed Dec 15, 2024
2 parents 5841993 + e907dd5 commit ca6c1a9
Show file tree
Hide file tree
Showing 49 changed files with 1,245 additions and 703 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ updates:
- /instrumentor
- /odiglet
- /opampserver
- /instrumentation
schedule:
day: monday
interval: weekly
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ jobs:
run: |
git tag opampserver/${{ steps.extract_tag.outputs.tag }}
- name: tag instrumentation
run: |
git tag instrumentation/${{ steps.extract_tag.outputs.tag }}
- name: Push Module Tags
run: |
git push origin --tags
Expand Down
12 changes: 8 additions & 4 deletions autoscaler/controllers/datacollection/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ func getDesiredDaemonSet(datacollection *odigosv1.CollectorsGroup,
rollingUpdate.MaxSurge = &maxSurge
}

requestMemoryRequestQuantity := resource.MustParse(fmt.Sprintf("%dMi", datacollection.Spec.ResourcesSettings.MemoryRequestMiB))
requestMemoryLimitQuantity := resource.MustParse(fmt.Sprintf("%dMi", datacollection.Spec.ResourcesSettings.MemoryLimitMiB))
resourceMemoryRequestQuantity := resource.MustParse(fmt.Sprintf("%dMi", datacollection.Spec.ResourcesSettings.MemoryRequestMiB))
resourceMemoryLimitQuantity := resource.MustParse(fmt.Sprintf("%dMi", datacollection.Spec.ResourcesSettings.MemoryLimitMiB))
resourceCpuRequestQuantity := resource.MustParse(fmt.Sprintf("%dm", datacollection.Spec.ResourcesSettings.CpuRequestMillicores))
resourceCpuLimitQuantity := resource.MustParse(fmt.Sprintf("%dm", datacollection.Spec.ResourcesSettings.CpuLimitMillicores))

desiredDs := &appsv1.DaemonSet{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -326,10 +328,12 @@ func getDesiredDaemonSet(datacollection *odigosv1.CollectorsGroup,
},
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceMemory: requestMemoryRequestQuantity,
corev1.ResourceMemory: resourceMemoryRequestQuantity,
corev1.ResourceCPU: resourceCpuRequestQuantity,
},
Limits: corev1.ResourceList{
corev1.ResourceMemory: requestMemoryLimitQuantity,
corev1.ResourceMemory: resourceMemoryLimitQuantity,
corev1.ResourceCPU: resourceCpuLimitQuantity,
},
},
SecurityContext: &corev1.SecurityContext{
Expand Down
13 changes: 13 additions & 0 deletions autoscaler/controllers/gateway/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,19 @@ func getDesiredDeployment(dests *odigosv1.DestinationList, configDataHash string
Name: "GOMEMLIMIT",
Value: fmt.Sprintf("%dMiB", gateway.Spec.ResourcesSettings.GomemlimitMiB),
},
{
// let the Go runtime know how many CPUs are available,
// without this, Go will assume all the cores are available.
Name: "GOMAXPROCS",
ValueFrom: &corev1.EnvVarSource{
ResourceFieldRef: &corev1.ResourceFieldSelector{
ContainerName: containerName,
// limitCPU, Kubernetes automatically rounds up the value to an integer
// (700m -> 1, 1200m -> 2)
Resource: "limits.cpu",
},
},
},
},
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: boolPtr(false),
Expand Down
15 changes: 13 additions & 2 deletions cli/cmd/resources/odigosconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,15 @@ func (a *odigosConfigResourceManager) Name() string { return "OdigosConfig" }
func (a *odigosConfigResourceManager) InstallFromScratch(ctx context.Context) error {

sizingProfile := k8sprofiles.FilterSizeProfiles(a.config.Profiles)

collectorGatewayConfig := GetGatewayConfigBasedOnSize(sizingProfile)
collectorNodeConfig := GetNodeCollectorConfigBasedOnSize(sizingProfile)
a.config.CollectorGateway = collectorGatewayConfig
if a.config.CollectorNode != nil {

collectorNodeConfig := GetNodeCollectorConfigBasedOnSize(sizingProfile)
if a.config.CollectorNode != nil && a.config.CollectorNode.CollectorOwnMetricsPort != 0 {
if collectorNodeConfig == nil {
collectorNodeConfig = &common.CollectorNodeConfiguration{}
}
collectorNodeConfig.CollectorOwnMetricsPort = a.config.CollectorNode.CollectorOwnMetricsPort
}
a.config.CollectorNode = collectorNodeConfig
Expand All @@ -77,16 +82,22 @@ func GetNodeCollectorConfigBasedOnSize(profile common.ProfileName) *common.Colle
return &common.CollectorNodeConfiguration{
RequestMemoryMiB: 150,
LimitMemoryMiB: 300,
RequestCPUm: 150,
LimitCPUm: 300,
}
case k8sprofiles.SizeMProfile.ProfileName:
return &common.CollectorNodeConfiguration{
RequestMemoryMiB: 250,
LimitMemoryMiB: 500,
RequestCPUm: 250,
LimitCPUm: 500,
}
case k8sprofiles.SizeLProfile.ProfileName:
return &common.CollectorNodeConfiguration{
RequestMemoryMiB: 500,
LimitMemoryMiB: 750,
RequestCPUm: 500,
LimitCPUm: 750,
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions cli/cmd/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
)

const (
defaultPort = 3000
betaDefaultPort = 3001
defaultPort = 3000
legacyDefaultPort = 3001
)

// uiCmd represents the ui command
Expand All @@ -50,12 +50,12 @@ var uiCmd = &cobra.Command{
}
}

betaFlag, _ := cmd.Flags().GetBool("beta")
legacyFlag, _ := cmd.Flags().GetBool("legacy")
localPort := cmd.Flag("port").Value.String()
clusterPort := defaultPort

if betaFlag {
clusterPort = betaDefaultPort
if legacyFlag {
clusterPort = legacyDefaultPort
}

localAddress := cmd.Flag("address").Value.String()
Expand Down
4 changes: 2 additions & 2 deletions common/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (

require (
github.com/kr/pretty v0.3.1 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
Expand All @@ -24,7 +24,7 @@ require (
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/otel v1.29.0
golang.org/x/sys v0.18.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

Expand Down
8 changes: 4 additions & 4 deletions common/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw=
Expand All @@ -46,8 +46,8 @@ golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
10 changes: 10 additions & 0 deletions common/odigos_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ type CollectorNodeConfiguration struct {
// default value is 2x the memory request.
LimitMemoryMiB int `json:"limitMemoryMiB,omitempty"`

// RequestCPUm is the CPU request for the node collector daemonset.
// it will be embedded in the daemonset as a resource request of the form "cpu: <value>m"
// default value is 250m
RequestCPUm int `json:"requestCPUm,omitempty"`

// LimitCPUm is the CPU limit for the node collector daemonset.
// it will be embedded in the daemonset as a resource limit of the form "cpu: <value>m"
// default value is 500m
LimitCPUm int `json:"limitCPUm,omitempty"`

// this parameter sets the "limit_mib" parameter in the memory limiter configuration for the node collector.
// it is the hard limit after which a force garbage collection will be performed.
// if not set, it will be 50Mi below the memory request.
Expand Down
2 changes: 1 addition & 1 deletion destinations/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/odigos-io/odigos/destinations
go 1.23.0

require (
github.com/odigos-io/odigos/common v1.0.48
github.com/odigos-io/odigos/common v0.0.0
gopkg.in/yaml.v3 v3.0.1
)

Expand Down
4 changes: 2 additions & 2 deletions destinations/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw=
Expand Down
30 changes: 20 additions & 10 deletions docs/pipeline/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ Sizing Profiles `size_s`, `size_m`, `size_l` are pre-defined configurations desi

**Node Data Collection Collector**:

| Profile | Request Memory (Mi) | Limit Memory (Mi) |
|----------|----------------------|-------------------|
| `size_s` | **150Mi** | **300Mi** |
| `size_m` | **250Mi** | **500Mi** |
| `size_l` | **500Mi** | **750Mi** |
| Profile | Request Memory (Mi) | Limit Memory (Mi) | Request CPU (m) | Limit CPU (m)
|----------|----------------------|-------------------| ---------------------|-------------------|
| `size_s` | **150Mi** | **300Mi** | **150m** | **300m** |
| `size_m` | **250Mi** | **500Mi** | **250m** | **500m** |
| `size_l` | **500Mi** | **750Mi** | **500m** | **750m** |


To use profiles, you need to use the [Odigos CLI Command for Profiles](/cli/odigos_profile).
Expand Down Expand Up @@ -96,27 +96,37 @@ collectorNode:
# RequestMemoryMiB is the memory request for the node collector daemonset.
# it will be embedded in the daemonset as a resource request of the form "memory: <value>Mi"
# default value is 250Mi
RequestMemoryMiB int `json:"requestMemoryMiB,omitempty"`
requestMemoryMiB: 250

# LimitMemoryMiB is the memory limit for the node collector daemonset.
# it will be embedded in the daemonset as a resource limit of the form "memory: <value>Mi"
# default value is 2x the memory request.
LimitMemoryMiB int `json:"limitMemoryMiB,omitempty"`
limitMemoryMiB: 500

# RequestCPUm is the CPU request for the node collector daemonset.
# it will be embedded in the daemonset as a resource request of the form "cpu: <value>m"
# default value is 250m
requestCPUm: 250

# LimitCPUm is the CPU limit for the node collector daemonset.
# it will be embedded in the daemonset as a resource limit of the form "cpu: <value>m"
# default value is 500m
limitCPUm: 500

# this parameter sets the "limit_mib" parameter in the memory limiter configuration for the node collector.
# it is the hard limit after which a force garbage collection will be performed.
# if not set, it will be 50Mi below the memory request.
MemoryLimiterLimitMiB int `json:"memoryLimiterLimitMiB,omitempty"`
memoryLimiterLimitMiB:

# this parameter sets the "spike_limit_mib" parameter in the memory limiter configuration for the node collector.
# note that this is not the processor soft limit, but the diff in Mib between the hard limit and the soft limit.
# if not set, this will be set to 20% of the hard limit (so the soft limit will be 80% of the hard limit).
MemoryLimiterSpikeLimitMiB int `json:"memoryLimiterSpikeLimitMiB,omitempty"`
memoryLimiterSpikeLimitMiB:

# the GOMEMLIMIT environment variable value for the node collector daemonset.
# this is when go runtime will start garbage collection.
# if not specified, it will be set to 80% of the hard limit of the memory limiter.
GoMemLimitMib int `json:"goMemLimitMiB,omitempty"`
goMemLimitMiB:
```
Expand Down
9 changes: 4 additions & 5 deletions docs/quickstart/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,13 @@ odigos ui

By default, Odigos UI is available at http://localhost:3000.

## Experimental: New UI with --beta flag
## Using the Legacy UI

```bash
odigos ui --beta
odigos ui --legacy
```

<Warning>
The --beta flag provides access to a new, improved UI. Keep in mind that this
is an experimental feature and may include changes or incomplete
functionality.
The new UI is the default experience. The legacy UI remains available for
users who prefer the previous version.
</Warning>
16 changes: 7 additions & 9 deletions frontend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ import (

const (
defaultPort = 3000
betaPort = 3001
legacyPort = 3001
)

type Flags struct {
Version bool
Address string
Port int
BetaPort int
LegacyPort int
Debug bool
KubeConfig string
Namespace string
Expand All @@ -68,7 +68,7 @@ func parseFlags() Flags {
flag.BoolVar(&flags.Version, "version", false, "Print Odigos UI version.")
flag.StringVar(&flags.Address, "address", "localhost", "Address to listen on")
flag.IntVar(&flags.Port, "port", defaultPort, "Port to listen on")
flag.IntVar(&flags.BetaPort, "beta-port", betaPort, "Port to listen on for beta UI")
flag.IntVar(&flags.LegacyPort, "legacy-port", legacyPort, "Port to listen on for legacy UI")
flag.BoolVar(&flags.Debug, "debug", false, "Enable debug mode")
flag.StringVar(&flags.KubeConfig, "kubeconfig", defaultKubeConfig, "Path to kubeconfig file")
flag.StringVar(&flags.Namespace, "namespace", consts.DefaultOdigosNamespace, "Kubernetes namespace where Odigos is installed")
Expand Down Expand Up @@ -334,20 +334,18 @@ func main() {
r.GET("/api/events", sse.HandleSSEConnections)
d.GET("/api/events", sse.HandleSSEConnections)

log.Println("Starting Odigos UI...")
log.Printf("Odigos UI is available at: http://%s:%d", flags.Address, flags.BetaPort)
log.Printf("Odigos UI is available at: http://%s:%d", flags.Address, flags.Port)

go func() {
err = r.Run(fmt.Sprintf("%s:%d", flags.Address, flags.BetaPort))
err = r.Run(fmt.Sprintf("%s:%d", flags.Address, flags.Port))
if err != nil {
log.Fatalf("Error starting server: %s", err)
}
}()

go func() {
log.Println("Starting Odigos Dep UI...")
log.Printf("Odigos UI is available at: http://%s:%d", flags.Address, flags.Port)
err = d.Run(fmt.Sprintf("%s:%d", flags.Address, flags.Port))
log.Printf("Odigos Legacy UI is available at: http://%s:%d", flags.Address, flags.LegacyPort)
err = d.Run(fmt.Sprintf("%s:%d", flags.Address, flags.LegacyPort))
if err != nil {
log.Fatalf("Error starting server: %s", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ const renderValue = (type: DataCardRow['type'], value: DataCardRow['value']) =>
}
/>
)}
>
<InstrumentStatus language={language} />
</DataTab>
renderActions={() => <InstrumentStatus language={language} />}
/>
);
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/webapp/reuseable-components/data-tab/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { Fragment, PropsWithChildren, useCallback, useState } from 'react';
import React, { Fragment, useCallback, useState } from 'react';
import Image from 'next/image';
import { FlexColumn, FlexRow } from '@/styles';
import styled, { css } from 'styled-components';
import { ActiveStatus, Divider, ExtendIcon, IconButton, MonitorsIcons, Text } from '@/reuseable-components';

interface Props extends PropsWithChildren {
interface Props {
title: string;
subTitle: string;
logo: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ const BaseNode: React.FC<Props> = ({ id: nodeId, data }) => {

return (
<Container data-id={nodeId} $nodeWidth={nodeWidth} className='nowheel nodrag'>
<DataTab title={title} subTitle={subTitle} logo={imageUri} monitors={monitors} isActive={isActive} isError={isError} onClick={() => {}}>
{renderActions()}
</DataTab>

<DataTab title={title} subTitle={subTitle} logo={imageUri} monitors={monitors} isActive={isActive} isError={isError} onClick={() => {}} renderActions={renderActions} />
<Handle type='target' position={Position.Left} style={{ visibility: 'hidden' }} />
<Handle type='source' position={Position.Right} style={{ visibility: 'hidden' }} />
</Container>
Expand Down
6 changes: 6 additions & 0 deletions helm/odigos/templates/odigos-config-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ data:
{{- with .Values.collectorNode.limitMemoryMiB }}
limitMemoryMiB: {{ . }}
{{- end }}
{{- with .Values.collectorNode.requestCPUm }}
requestCPUm: {{ . }}
{{- end }}
{{- with .Values.collectorNode.limitCPUm }}
limitCPUm: {{ . }}
{{- end }}
{{- with .Values.collectorNode.memoryLimiterLimitMiB }}
memoryLimiterLimitMiB: {{ . }}
{{- end }}
Expand Down
Loading

0 comments on commit ca6c1a9

Please sign in to comment.