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

Converter integrations next wired in to the UI and backend #188

Merged
merged 5 commits into from
Feb 1, 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
9 changes: 8 additions & 1 deletion backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion src/components/Converter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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",
Expand Down
Loading