Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ input RegisterInfraRequest {
"""
nodeSelector: String
"""
TelemetryEndpoint value indicating telemetry endpoint for infra
"""
TelemetryEndpoint: String
"""
Node tolerations used by infra
"""
tolerations: [Toleration]
Expand Down
10 changes: 5 additions & 5 deletions chaoscenter/graphql/server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/tidwall/sjson v1.2.5
github.com/vektah/gqlparser/v2 v2.5.16
go.mongodb.org/mongo-driver v1.16.1
golang.org/x/crypto v0.31.0
golang.org/x/crypto v0.33.0
google.golang.org/grpc v1.64.1
google.golang.org/protobuf v1.34.2
gopkg.in/yaml.v2 v2.4.0
Expand Down Expand Up @@ -103,10 +103,10 @@ require (
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
Expand Down
20 changes: 10 additions & 10 deletions chaoscenter/graphql/server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1254,8 +1254,8 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -1397,8 +1397,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20171026204733-164713f0dfce/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -1493,14 +1493,14 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915090833-1cbadb444a80/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -1514,8 +1514,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
13 changes: 12 additions & 1 deletion chaoscenter/graphql/server/graph/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions chaoscenter/graphql/server/graph/model/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ spec:
env:
- name: CHAOS_RUNNER_IMAGE
value: #{LITMUS_CHAOS_RUNNER}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: #{TELEMETRY_ENDPOINT}
- name: WATCH_NAMESPACE
value: ''
- name: POD_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ spec:
env:
- name: CHAOS_RUNNER_IMAGE
value: #{LITMUS_CHAOS_RUNNER}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: #{TELEMETRY_ENDPOINT}
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ func ManifestParser(infra dbChaosInfra.ChaosInfra, rootPath string, config *Subs
newContent = strings.Replace(newContent, "#{VERSION}", utils.Config.Version, -1)
newContent = strings.Replace(newContent, "#{SKIP_SSL_VERIFY}", skipSSL, -1)
newContent = strings.Replace(newContent, "#{CUSTOM_TLS_CERT}", config.TLSCert, -1)
newContent = strings.Replace(newContent, "#{TELEMETRY_ENDPOINT}", infra.TelemetryEndpoint, -1)

newContent = strings.Replace(newContent, "#{START_TIME}", "\""+infra.StartTime+"\"", -1)
if infra.IsInfraConfirmed {
Expand Down
29 changes: 15 additions & 14 deletions chaoscenter/graphql/server/pkg/chaos_infrastructure/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,21 @@ func (in *infraService) RegisterInfra(c context.Context, projectID string, input
Username: username,
},
},
EnvironmentID: input.EnvironmentID,
AccessKey: utils.RandomString(32),
PlatformName: input.PlatformName,
InfraNamespace: input.InfraNamespace,
ServiceAccount: input.ServiceAccount,
InfraScope: input.InfraScope,
InfraNsExists: input.InfraNsExists,
InfraSaExists: input.InfraSaExists,
Token: token,
InfraType: string(input.InfrastructureType),
NodeSelector: input.NodeSelector,
Tolerations: tolerations,
SkipSSL: input.SkipSsl,
StartTime: strconv.FormatInt(currentTime.UnixMilli(), 10),
EnvironmentID: input.EnvironmentID,
AccessKey: utils.RandomString(32),
PlatformName: input.PlatformName,
InfraNamespace: input.InfraNamespace,
ServiceAccount: input.ServiceAccount,
InfraScope: input.InfraScope,
InfraNsExists: input.InfraNsExists,
InfraSaExists: input.InfraSaExists,
Token: token,
InfraType: string(input.InfrastructureType),
NodeSelector: input.NodeSelector,
Tolerations: tolerations,
TelemetryEndpoint: *input.TelemetryEndpoint,
SkipSSL: input.SkipSsl,
StartTime: strconv.FormatInt(currentTime.UnixMilli(), 10),
}

err = in.infraOperator.InsertInfra(context.TODO(), newInfra)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type ChaosInfra struct {
SkipSSL *bool `bson:"skip_ssl"`
NodeSelector *string `bson:"node_selector"`
Tolerations []*Toleration `bson:"tolerations,omitempty"`
TelemetryEndpoint string `bson:"telemetry_endpoint"`
StartTime string `bson:"start_time"`
Version string `bson:"version"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface connectChaosInfraRequest {
skipSsl?: boolean;
nodeSelector?: string;
tolerations?: Array<Toleration>;
telemetryEndpoint?: string;
infrastructureType?: InfrastructureType;
tags?: Array<string>;
};
Expand Down
2 changes: 2 additions & 0 deletions chaoscenter/web/src/models/chaosInfrastructure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface InitialValueProps {
nodeSelectorValues?: Array<NodeSelector>;
tolerations: boolean;
tolerationValues?: Array<Toleration>;
telemetryEndpoint?: string;
}

export enum AllEnv {
Expand Down Expand Up @@ -111,6 +112,7 @@ export const initialValues: InitialValueProps = {
addNodeselector: false,
nodeSelectorValues: [{ key: '', value: '' }],
tolerations: false,
telemetryEndpoint: '',
tolerationValues: [
{
tolerationSeconds: 0,
Expand Down
3 changes: 3 additions & 0 deletions chaoscenter/web/src/strings/strings.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ enableChaosInfrastructureDesc: >-
enableCron: Enable Cron
enableCronDesc: This will enable the cron schedule for this experiment.
enableImageRegistryChanges: Enable Image Registry Changes
enableOpenTelemetry: Enable OpenTelemetry
enableSSLCheck: Enable SSL/TLS check
enableUser: Enable User
enableUserDescription: Are you sure you want to enable this user?
Expand Down Expand Up @@ -739,6 +740,7 @@ optional: (Optional)
or: or
orderBy: Order By
organization: Organization
otelExporterOtlpEndpoint: OTEL_EXPORTER_OTLP_ENDPOINT
outOf: OUT OF
outOfSmall: out of
overallNodeResult: Overall Node Result
Expand Down Expand Up @@ -1096,6 +1098,7 @@ targetInfrastructure: Target Infrastructure
taskIDSuccess: >-
Your Chaos Infrastructure deployment request has been successful with the
TaskID:
telemetry: Telemetry
templateFromChaosHubsDescription: Use experiments available in ChaosHubs
templateFromChaosHubsTitle: Templates from ChaosHubs
templateFromProjectDescription: Use experiments available in your Project
Expand Down
3 changes: 3 additions & 0 deletions chaoscenter/web/src/strings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ export interface StringsMap {
'enableCron': unknown
'enableCronDesc': unknown
'enableImageRegistryChanges': unknown
'enableOpenTelemetry': unknown
'enableSSLCheck': unknown
'enableUser': unknown
'enableUserDescription': unknown
Expand Down Expand Up @@ -612,6 +613,7 @@ export interface StringsMap {
'or': unknown
'orderBy': unknown
'organization': unknown
'otelExporterOtlpEndpoint': unknown
'outOf': unknown
'outOfSmall': unknown
'overallNodeResult': unknown
Expand Down Expand Up @@ -924,6 +926,7 @@ export interface StringsMap {
'targetApplication': unknown
'targetInfrastructure': unknown
'taskIDSuccess': unknown
'telemetry': unknown
'templateFromChaosHubsDescription': unknown
'templateFromChaosHubsTitle': unknown
'templateFromProjectDescription': unknown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ interface AdvancedChaosInfrastructureConfigProps {
setNodeSelectorToggle: React.Dispatch<React.SetStateAction<boolean>>;
tolerationToggle: boolean;
setTolerationToggle: React.Dispatch<React.SetStateAction<boolean>>;
telemetryToggle: boolean;
setTelemetryToggle: React.Dispatch<React.SetStateAction<boolean>>;
formikProps: FormikProps<InitialValueProps>;
}

Expand All @@ -93,6 +95,8 @@ function AdvancedChaosInfrastructureConfig({
setNodeSelectorToggle,
tolerationToggle,
setTolerationToggle,
telemetryToggle,
setTelemetryToggle,
formikProps
}: AdvancedChaosInfrastructureConfigProps): React.ReactElement {
const { getString } = useStrings();
Expand Down Expand Up @@ -254,6 +258,29 @@ function AdvancedChaosInfrastructureConfig({
/>
</Container>
)}
<Text font={{ variation: FontVariation.SMALL_SEMI }} color={Color.GREY_800}>
{getString('telemetry')}
</Text>
<FormInput.Toggle
name="enableTelemetry"
label={getString('enableOpenTelemetry')}
onToggle={() => {
setTelemetryToggle(!telemetryToggle);
}}
tooltipProps={{ dataTooltipId: 'chaos_infra_telemetry' }}
/>
{telemetryToggle && (
<FormInput.Text
className={css.formSubSection}
name="telemetryEndpoint"
placeholder={initialValues.telemetryEndpoint}
label={
<Text font={{ variation: FontVariation.SMALL_SEMI }} color={Color.GREY_800}>
{getString('otelExporterOtlpEndpoint')}
</Text>
}
/>
)}
</Layout.Vertical>
);
}
Expand Down Expand Up @@ -430,6 +457,7 @@ const ConfigureStep: React.FC<
const [isInfraPresent, setIsInfraPresent] = React.useState<boolean>(false);
const [nodeSelectorToggle, setNodeSelectorToggle] = React.useState(false);
const [tolerationToggle, setTolerationToggle] = React.useState(false);
const [telemetryToggle, setTelemetryToggle] = React.useState(false);
const prevStepData = props.prevStepData?.value;
return (
<Layout.Vertical height={'100%'}>
Expand Down Expand Up @@ -457,6 +485,7 @@ const ConfigureStep: React.FC<
// If toggle is switched off, discard the values
data.nodeSelectorValues = nodeSelectorToggle ? data.nodeSelectorValues : undefined;
data.tolerationValues = tolerationToggle ? data.tolerationValues : undefined;
data.telemetryEndpoint = telemetryToggle ? data.telemetryEndpoint : undefined;
props.nextStep?.({ value: data });
}}
>
Expand Down Expand Up @@ -502,6 +531,8 @@ const ConfigureStep: React.FC<
setNodeSelectorToggle={setNodeSelectorToggle}
tolerationToggle={tolerationToggle}
setTolerationToggle={setTolerationToggle}
telemetryToggle={telemetryToggle}
setTelemetryToggle={setTelemetryToggle}
formikProps={formikProps}
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default function KubernetesChaosInfrastructureGreenfieldView({
nodeSelector: data.value.nodeSelectorValues
? `${data.value.nodeSelectorValues[0].key.trim()}=${data.value.nodeSelectorValues[0].value.trim()}`
: undefined,
telemetryEndpoint: data.value.telemetryEndpoint ?? undefined,
tags: data.value.tags ?? undefined,
infrastructureType: InfrastructureType.KUBERNETES
}
Expand Down
Loading