package com.cameleer.server.app.runtime;

import java.util.LinkedHashMap;
import java.util.Map;

public final class PrometheusLabelBuilder {

    private PrometheusLabelBuilder() {}

    public static Map<String, String> build(String resolvedRuntimeType) {
        Map<String, String> labels = new LinkedHashMap<>();
        labels.put("prometheus.scrape", "true");

        switch (resolvedRuntimeType) {
            case "spring-boot" -> {
                labels.put("prometheus.path", "/actuator/prometheus");
                labels.put("prometheus.port", "8081");
            }
            case "quarkus", "native" -> {
                labels.put("prometheus.path", "/q/metrics");
                labels.put("prometheus.port", "9000");
            }
            case "plain-java" -> {
                labels.put("prometheus.path", "/metrics");
                labels.put("prometheus.port", "9464");
            }
            default -> {
                labels.put("prometheus.path", "/actuator/prometheus");
                labels.put("prometheus.port", "8081");
            }
        }

        return labels;
    }
}
