9e1beb6895
Rewrite of some of the Apps to Nix. Tried to convert
ApplicationSets to simple Applications with an ${env}
modifier.
118 lines
3.4 KiB
Nix
118 lines
3.4 KiB
Nix
{ lib, config, ... }:
|
|
let
|
|
cfg = config.apps.opentelemetry-collector;
|
|
env = config.apps.env;
|
|
|
|
values = lib.apps.appValues {
|
|
inherit env;
|
|
extraValues = {
|
|
mode = "deployment";
|
|
image = {
|
|
repository = "otel/opentelemetry-collector-k8s";
|
|
};
|
|
service = {
|
|
type = "LoadBalancer";
|
|
loadBalancerIP = "10.255.241.12";
|
|
};
|
|
config = {
|
|
receivers = {
|
|
"prometheus/collector" = {
|
|
config.scrape_configs = [{
|
|
job_name = "opentelemetry-collector";
|
|
static_configs = [{
|
|
targets = [ "\${env:MY_POD_IP}:8888" ];
|
|
}];
|
|
}];
|
|
};
|
|
zipkin.endpoint = "\${env:MY_POD_IP}:9411";
|
|
};
|
|
exporters = {
|
|
otlp = {
|
|
endpoint = "tempo.tempo.svc:4317";
|
|
tls.insecure = true;
|
|
};
|
|
"otlphttp/metrics" = {
|
|
endpoint = "http://prom-prometheus.prometheus:9090/api/v1/otlp";
|
|
tls.insecure = true;
|
|
};
|
|
"otlphttp/logs" = {
|
|
endpoint = "http://loki-write-headless.loki:3100/otlp";
|
|
tls.insecure = true;
|
|
};
|
|
"debug/metrics".verbosity = "detailed";
|
|
"debug/traces".verbosity = "detailed";
|
|
"debug/logs".verbosity = "detailed";
|
|
};
|
|
service = {
|
|
telemetry.logs.level = "info";
|
|
pipelines = {
|
|
traces = {
|
|
receivers = [ "otlp" "zipkin" ];
|
|
processors = [ "batch" ];
|
|
exporters = [ "otlp" ];
|
|
};
|
|
metrics = {
|
|
receivers = [ "otlp" "prometheus/collector" ];
|
|
processors = [ "batch" ];
|
|
exporters = [ "otlphttp/metrics" ];
|
|
};
|
|
logs = {
|
|
receivers = [ "otlp" ];
|
|
processors = [ "batch" ];
|
|
exporters = [ "otlphttp/logs" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
ports.metrics.enabled = true;
|
|
ingress = {
|
|
enabled = false;
|
|
annotations = {
|
|
"cert-manager.io/cluster-issuer" = "letsencrypt-production";
|
|
"nginx.ingress.kubernetes.io/ssl-redirect" = "true";
|
|
"atlantis.oceanbox.io/expose" = "internal";
|
|
};
|
|
ingressClassName = "nginx";
|
|
hosts = [{
|
|
host = "opentelemetry-collector.adm.oceanbox.io";
|
|
paths = [{
|
|
path = "/";
|
|
pathType = "Prefix";
|
|
port = 4318;
|
|
}];
|
|
}];
|
|
tls = [{
|
|
secretName = "collector-tls";
|
|
hosts = [ "opentelemetry-collector.adm.oceanbox.io" ];
|
|
}];
|
|
};
|
|
};
|
|
};
|
|
|
|
in
|
|
{
|
|
options.apps.opentelemetry-collector = lib.apps.appOptions {
|
|
revision = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "0.107.0";
|
|
description = "OpenTelemetry Collector chart version";
|
|
};
|
|
};
|
|
|
|
config = lib.apps.appConfig cfg "opentelemetry-collector" {
|
|
namespace = "argocd";
|
|
helm.releases.opentelemetry-collector = {
|
|
inherit values;
|
|
chart = lib.helm.downloadHelmChart {
|
|
repo = "https://open-telemetry.github.io/opentelemetry-helm-charts";
|
|
chart = "opentelemetry-collector";
|
|
version = cfg.revision;
|
|
chartHash = "sha256-0000000000000000000000000000000000000000000000"; # TODO: Add correct hash
|
|
};
|
|
};
|
|
annotations = {
|
|
"argocd.argoproj.io/sync-options" = "SkipDryRunOnMissingResource=true";
|
|
};
|
|
};
|
|
}
|