diff --git a/backend/main.go b/backend/main.go index 549efd5..338737f 100644 --- a/backend/main.go +++ b/backend/main.go @@ -39,7 +39,14 @@ func convert(w http.ResponseWriter, r *http.Request) { http.Error(w, fmt.Sprintf("decoding request: %s", err.Error()), http.StatusBadRequest) return } - out, diag := converter.Convert([]byte(cr.Data), cr.Type, nil) + + var extraArgs []string = nil + if cr.Type == "static integrations-next" { + cr.Type = "static" + extraArgs = []string{"-enable-features", "integrations-next", "-config.expand-env"} + } + + out, diag := converter.Convert([]byte(cr.Data), cr.Type, extraArgs) json.NewEncoder(w).Encode(ConversionResponse{ Data: string(out), Diagnostics: diag, diff --git a/src/components/Converter/index.tsx b/src/components/Converter/index.tsx index 2d10c00..6e07d4a 100644 --- a/src/components/Converter/index.tsx +++ b/src/components/Converter/index.tsx @@ -14,7 +14,7 @@ import { useModelContext } from "../../state"; import { Controller, FormProvider, useForm } from "react-hook-form"; import { useMemo, useState } from "react"; -type InputType = "prometheus" | "promtail" | "static"; +type InputType = "prometheus" | "promtail" | "static" | "static integrations-next"; interface Diagnostic { Severity: number; @@ -116,6 +116,10 @@ const Converter = ({ dismiss }: { dismiss: () => void }) => { label: "Grafana Agent Static", value: "static", }, + { + label: "Grafana Agent Static Integrations Next", + value: "static integrations-next", + }, { label: "Prometheus", value: "prometheus",