mirror of
https://github.com/zoriya/flake.git
synced 2026-06-05 11:39:51 +00:00
wip: otel stuff
This commit is contained in:
@@ -32,6 +32,10 @@
|
|||||||
";
|
";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
imports = [
|
||||||
|
./otel.nix
|
||||||
|
];
|
||||||
|
|
||||||
# Make it use predictable interface names starting with eth0
|
# Make it use predictable interface names starting with eth0
|
||||||
boot.kernelParams = ["net.ifnames=0"];
|
boot.kernelParams = ["net.ifnames=0"];
|
||||||
|
|
||||||
@@ -53,18 +57,6 @@ in {
|
|||||||
maxretry = 5;
|
maxretry = 5;
|
||||||
};
|
};
|
||||||
|
|
||||||
# virtualisation.oci-containers.containers."watchtower" = {
|
|
||||||
# autoStart = true;
|
|
||||||
# image = "containrrr/watchtower";
|
|
||||||
# volumes = [
|
|
||||||
# "/var/run/docker.sock:/var/run/docker.sock"
|
|
||||||
# ];
|
|
||||||
# environment = {
|
|
||||||
# WATCHTOWER_CLEANUP = "true";
|
|
||||||
# WATCHTOWER_POLL_INTERVAL = "86400";
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [80 443];
|
networking.firewall.allowedTCPPorts = [80 443];
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -132,10 +124,27 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtualHosts."otel.sdg.moe" = {
|
||||||
|
enableACME = true;
|
||||||
|
addSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:4318";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
extraConfig = "proxy_pass_header Authorization;";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# virtualHosts."otel-groc.sdg.moe" = {
|
||||||
|
# enableACME = true;
|
||||||
|
# addSSL = true;
|
||||||
|
# locations."/" = {
|
||||||
|
# grpcPass = "http://localhost:4317";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
virtualHosts."grafana.sdg.moe" = {
|
virtualHosts."grafana.sdg.moe" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
addSSL = true;
|
addSSL = true;
|
||||||
location."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:1892";
|
proxyPass = "http://localhost:1892";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
@@ -192,19 +201,4 @@ in {
|
|||||||
DISABLE_SSH = true;
|
DISABLE_SSH = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.opentelemetry-collector = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.grafana = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
server = {
|
|
||||||
http_addr = "localhost";
|
|
||||||
http_port = 1892;
|
|
||||||
domain = "grafana.sdg.moe";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
|
||||||
|
services.opentelemetry-collector = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.opentelemetry-collector-contrib;
|
||||||
|
configFile = ./otelcol.yaml;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.mimir = {
|
||||||
|
enable = true;
|
||||||
|
configuration = {
|
||||||
|
server = {
|
||||||
|
http_listen_port = 1880;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.loki = {
|
||||||
|
enable = true;
|
||||||
|
configuration = {
|
||||||
|
server = {
|
||||||
|
http_listen_port = 1881;
|
||||||
|
};
|
||||||
|
storage_config = {
|
||||||
|
filesystem = {
|
||||||
|
directory = "/var/lib/loki/chunks";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
common = {
|
||||||
|
path_prefix = "/var/lib/loki";
|
||||||
|
};
|
||||||
|
schema_config = {
|
||||||
|
configs = [
|
||||||
|
{
|
||||||
|
from = "2020-05-15";
|
||||||
|
store = "tsdb";
|
||||||
|
object_store = "filesystem";
|
||||||
|
schema= "v13";
|
||||||
|
index = {
|
||||||
|
prefix = "index_";
|
||||||
|
period = "24h";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.tempo = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
http_listen_port = 1882;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.grafana = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
http_addr = "127.0.0.1";
|
||||||
|
http_port = 1892;
|
||||||
|
domain = "grafana.sdg.moe";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
receivers:
|
||||||
|
otlp:
|
||||||
|
protocols:
|
||||||
|
grpc:
|
||||||
|
endpoint: localhost:4317
|
||||||
|
auth:
|
||||||
|
authenticator: basicauth/server
|
||||||
|
http:
|
||||||
|
endpoint: localhost:4318
|
||||||
|
auth:
|
||||||
|
authenticator: basicauth/server
|
||||||
|
|
||||||
|
extensions:
|
||||||
|
basicauth/server:
|
||||||
|
htpasswd:
|
||||||
|
inline: |
|
||||||
|
otel-user:thisissecretpleasedontuseit
|
||||||
|
|
||||||
|
processors:
|
||||||
|
batch:
|
||||||
|
|
||||||
|
exporters:
|
||||||
|
otlp/jaeger: # Jaeger supports OTLP directly
|
||||||
|
endpoint: https://jaeger.example.com:4317
|
||||||
|
prometheusremotewrite: # the PRW exporter, to ingest metrics to backend
|
||||||
|
endpoint: https://prw.example.com/v1/api/remote_write
|
||||||
|
file: # the File Exporter, to ingest logs to local file
|
||||||
|
path: ./app42_example.log
|
||||||
|
rotation:
|
||||||
|
|
||||||
|
service:
|
||||||
|
extensions: [basicauth/server]
|
||||||
|
pipelines:
|
||||||
|
traces/dev:
|
||||||
|
receivers: [otlp]
|
||||||
|
processors: [batch]
|
||||||
|
exporters: [otlp/jaeger]
|
||||||
|
metrics/prod:
|
||||||
|
receivers: [otlp]
|
||||||
|
processors: [batch]
|
||||||
|
exporters: [prometheusremotewrite]
|
||||||
|
logs/dev:
|
||||||
|
receivers: [otlp]
|
||||||
|
processors: [batch]
|
||||||
|
exporters: [file]
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
"/var/lib/flatpak"
|
"/var/lib/flatpak"
|
||||||
"/var/lib/tcc"
|
"/var/lib/tcc"
|
||||||
"/var/lib/flood"
|
"/var/lib/flood"
|
||||||
|
"/var/lib/loki"
|
||||||
"/var/lib/transmission"
|
"/var/lib/transmission"
|
||||||
"/var/lib/gitea"
|
"/var/lib/gitea"
|
||||||
"/var/lib/acme"
|
"/var/lib/acme"
|
||||||
|
|||||||
Reference in New Issue
Block a user