Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/instrumentor/github.co…
Browse files Browse the repository at this point in the history
…m/onsi/gomega-1.36.0
  • Loading branch information
tamirdavid1 authored Nov 26, 2024
2 parents 83f9950 + 0ae9144 commit 55b2757
Show file tree
Hide file tree
Showing 106 changed files with 1,443 additions and 1,633 deletions.
5 changes: 5 additions & 0 deletions cli/cmd/resources/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ func NewUIClusterRole() *rbacv1.ClusterRole {
Resources: []string{"namespaces"},
Verbs: []string{"get", "list", "watch", "patch"},
},
{
APIGroups: []string{""},
Resources: []string{"services"},
Verbs: []string{"list"},
},
{
APIGroups: []string{""},
Resources: []string{"configmaps"},
Expand Down
8 changes: 8 additions & 0 deletions common/config/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/goccy/go-yaml"
"github.com/odigos-io/odigos/common"
"github.com/odigos-io/odigos/common/consts"
)

const (
Expand Down Expand Up @@ -151,6 +152,13 @@ func getBasicConfig(memoryLimiterConfig GenericMap) (*Config, []string) {
// setting it to a large value to avoid dropping batches.
"max_recv_msg_size_mib": 128,
"endpoint": "0.0.0.0:4317",
// The Node Collector opens a gRPC stream to send data. This ensures that the Node Collector establishes a new connection when the Gateway scales up to include additional instances.
"keepalive": GenericMap{
"server_parameters": GenericMap{
"max_connection_age": consts.GatewayMaxConnectionAge,
"max_connection_age_grace": consts.GatewayMaxConnectionAgeGrace,
},
},
},
// Node collectors send in gRPC, so this is probably not needed
"http": GenericMap{
Expand Down
4 changes: 4 additions & 0 deletions common/config/testdata/debugexporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ receivers:
protocols:
grpc:
endpoint: 0.0.0.0:4317
keepalive:
server_parameters:
max_connection_age: 15s
max_connection_age_grace: 2s
max_recv_msg_size_mib: 128
http:
endpoint: 0.0.0.0:4318
Expand Down
4 changes: 4 additions & 0 deletions common/config/testdata/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ receivers:
protocols:
grpc:
endpoint: 0.0.0.0:4317
keepalive:
server_parameters:
max_connection_age: 15s
max_connection_age_grace: 2s
max_recv_msg_size_mib: 128
http:
endpoint: 0.0.0.0:4318
Expand Down
4 changes: 4 additions & 0 deletions common/consts/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const (
InstrumentationDisabled = "disabled"
OdigosReportedNameAnnotation = "odigos.io/reported-name"

// GatewayMaxConnectionAge and GatewayMaxConnectionAgeGrace are the default values for the gateway collector.
GatewayMaxConnectionAge = "15s"
GatewayMaxConnectionAgeGrace = "2s"

// Used to store the original value of the environment variable in the pod manifest.
// This is used to restore the original value when an instrumentation is removed
// or odigos is uninstalled.
Expand Down
7 changes: 6 additions & 1 deletion frontend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ func httpFileServerWith404(fs http.FileSystem) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_, err := fs.Open(r.URL.Path)
if err != nil {
// Redirect to root path
// If file not found, serve .html of it (example: /choose-sources -> /choose-sources.html)
r.URL.Path = r.URL.Path + ".html"
}
_, err = fs.Open(r.URL.Path)
if err != nil {
// If .html file not found, this route does not exist at all (404) so we should redirect to default
r.URL.Path = "/"
}
http.FileServer(fs).ServeHTTP(w, r)
Expand Down
4 changes: 2 additions & 2 deletions frontend/webapp/app/(setup)/choose-destination/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import React from 'react';
import { SideMenu } from '@/components';
import { SideMenuWrapper } from '../styled';
import { ChooseDestinationContainer } from '@/containers/main';
import { AddDestinationContainer } from '@/containers/main';

export default function ChooseDestinationPage() {
return (
<>
<SideMenuWrapper>
<SideMenu currentStep={3} />
</SideMenuWrapper>
<ChooseDestinationContainer />
<AddDestinationContainer />
</>
);
}
5 changes: 5 additions & 0 deletions frontend/webapp/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Kode+Mono:wght@100;200;300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;700&display=swap');

* {
scrollbar-color: black transparent;
scrollbar-width: thin;
}
3 changes: 1 addition & 2 deletions frontend/webapp/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import { ApolloWrapper } from '@/lib';
import { ThemeProviderWrapper } from '@/styles';

const LAYOUT_STYLE: React.CSSProperties = {
margin: 0,
position: 'fixed',
scrollbarWidth: 'none',
width: '100vw',
height: '100vh',
margin: 0,
backgroundColor: '#111111',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ export const ConfiguredFields: React.FC<ConfiguredFieldsProps> = ({ details }) =
<ListContainer>
{details.map((detail, index) => (
<ListItem key={index}>
<Tooltip text={detail.tooltip || ''}>
<Tooltip text={detail.tooltip || ''} withIcon>
<ItemTitle>{detail.title}</ItemTitle>
{detail.tooltip && <Image src='/icons/common/info.svg' alt='Info' width={12} height={12} style={{ marginLeft: 4 }} />}
</Tooltip>

{detail.title === 'Status' ? <Status isActive={detail.value == 'true'} withIcon withBorder withSmaller withSpecialFont /> : <ItemValue>{parseValue(detail.value)}</ItemValue>}
Expand Down

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/webapp/components/destinations/index.ts

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion frontend/webapp/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export * from './setup';
export * from './overview';
export * from './common';
export * from './destinations';
export * from './main';
export * from './modals';
export * from './notification';
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { useMemo, useState } from 'react';
import { ActionFormBody } from '../';
import styled from 'styled-components';
import { getActionIcon } from '@/utils';
import { useDrawerStore } from '@/store';
import { CardDetails } from '@/components';
import type { ActionDataParsed } from '@/types';
import { ChooseActionBody } from '../choose-action-body';
import { useActionCRUD, useActionFormData } from '@/hooks';
import OverviewDrawer from '../../overview/overview-drawer';
import { ACTION_OPTIONS } from '../action-modal/action-options';
import buildCardFromActionSpec from './build-card-from-action-spec';
import { ACTION_OPTIONS } from '../choose-action-modal/action-options';

interface Props {}

Expand Down Expand Up @@ -36,7 +36,10 @@ const ActionDrawer: React.FC<Props> = () => {
}

const { item } = selectedItem as { item: ActionDataParsed };
const found = ACTION_OPTIONS.find(({ type }) => type === item.type) || ACTION_OPTIONS.find(({ id }) => id === 'sampler')?.items?.find(({ type }) => type === item.type);
const found =
ACTION_OPTIONS.find(({ type }) => type === item.type) ||
ACTION_OPTIONS.find(({ id }) => id === 'attributes')?.items?.find(({ type }) => type === item.type) ||
ACTION_OPTIONS.find(({ id }) => id === 'sampler')?.items?.find(({ type }) => type === item.type);

if (!found) return undefined;

Expand Down Expand Up @@ -86,7 +89,7 @@ const ActionDrawer: React.FC<Props> = () => {
>
{isEditing && thisAction ? (
<FormContainer>
<ChooseActionBody
<ActionFormBody
isUpdate
action={thisAction}
formData={formData}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@ const AddClusterInfo: React.FC<Props> = ({ value, setValue }) => {
key: obj.attributeName,
value: obj.attributeStringValue,
})),
[value]
[value],
);

const handleChange = (
arr: {
key: string;
value: string;
}[]
) => {
const handleChange = (arr: { key: string; value: string }[]) => {
const payload: Parsed = {
clusterAttributes: arr.map((obj) => ({
attributeName: obj.key,
Expand All @@ -38,7 +33,7 @@ const AddClusterInfo: React.FC<Props> = ({ value, setValue }) => {
setValue(str);
};

return <KeyValueInputsList title='Attributes to add' required value={mappedValue} onChange={handleChange} />;
return <KeyValueInputsList title='Resource Attributes' required value={mappedValue} onChange={handleChange} />;
};

export default AddClusterInfo;
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ const ErrorSampler: React.FC<Props> = ({ value, setValue }) => {
const mappedValue = useMemo(() => safeJsonParse<Parsed>(value, { fallback_sampling_ratio: 0 }).fallback_sampling_ratio, [value]);

const handleChange = (val: string) => {
let num = Number(val);

if (Number.isNaN(num) || num < MIN || num > MAX) {
num = MIN;
}
const num = Math.max(MIN, Math.min(Number(val), MAX)) || MIN;

const payload: Parsed = {
fallback_sampling_ratio: num,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import styled from 'styled-components';
import { type ActionInput } from '@/types';
import ActionCustomFields from './custom-fields';
import { type ActionOption } from '../choose-action-modal/action-options';
import { type ActionOption } from '../action-modal/action-options';
import { DocsButton, Input, Text, TextArea, MonitoringCheckboxes, SectionTitle, ToggleButtons } from '@/reuseable-components';

interface ChooseActionContentProps {
interface Props {
isUpdate?: boolean;
action: ActionOption;
formData: ActionInput;
Expand All @@ -23,7 +23,7 @@ const FieldTitle = styled(Text)`
margin-bottom: 12px;
`;

const ChooseActionBody: React.FC<ChooseActionContentProps> = ({ isUpdate, action, formData, handleFormChange }) => {
export const ActionFormBody: React.FC<Props> = ({ isUpdate, action, formData, handleFormChange }) => {
return (
<Container>
{isUpdate && (
Expand All @@ -45,5 +45,3 @@ const ChooseActionBody: React.FC<ChooseActionContentProps> = ({ isUpdate, action
</Container>
);
};

export { ChooseActionBody };
Loading

0 comments on commit 55b2757

Please sign in to comment.