Skip to content
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
5 changes: 3 additions & 2 deletions client/lomas_client/models/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from functools import cached_property
from typing import Annotated

import requests
from pydantic import HttpUrl, computed_field
from pydantic import Field, HttpUrl, computed_field
from pydantic_settings import BaseSettings, SettingsConfigDict

from lomas_core.models.config import OIDCConfig, Telemetry
Expand Down Expand Up @@ -29,7 +30,7 @@ class ClientConfig(BaseSettings):
"""User password."""
oidc_discovery_url: HttpUrl
"""The oidc provier discovery Url."""
telemetry: Telemetry
telemetry: Annotated[Telemetry, Field(default=Telemetry())]
"""Telemetry Settings."""

@computed_field
Expand Down
2 changes: 1 addition & 1 deletion core/lomas_core/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TimeAttack(BaseModel):
class Telemetry(BaseModel):
"""Telemetry config."""

enabled: bool
enabled: Annotated[bool, Field(default=False)]
service_name: Annotated[str, Field(default="lomas-server-app")]
service_id: Annotated[str, Field(default="default-host")]
collector_endpoint: Annotated[HttpUrl, UrlConstraints(default_port=4317)] | None = None
Expand Down
3 changes: 3 additions & 0 deletions deploy/charts/lomas/templates/prometheus/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ data:
- job_name: 'loki'
static_configs:
- targets: [ '{{ include "lomas.loki.fullname" .}}:{{ .Values.loki.service.port }}' ]
- job_name: 'rabbitmq'
static_configs:
- targets: [ '{{ .Values.rabbitmq.fullnameOverride}}:{{ .Values.rabbitmq.service.ports.metrics }}' ]
{{- end }}
12 changes: 6 additions & 6 deletions deploy/charts/lomas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ fullnameOverride: "lomas"
##########################################################################
server:
image:
repository: dsccadminch/lomas_server
repository: dsccadminch/lomas-raw
imagePullPolicy: Always
tag: latest
tag: sha-3642bd3

# Runtime args for server
runtime_args:
Expand Down Expand Up @@ -120,9 +120,9 @@ demoSetupJob:
create: true

image:
repository: dsccadminch/lomas_server
repository: dsccadminch/lomas-raw
imagePullPolicy: Always
tag: latest
tag: sha-3642bd3

config:
serverUrl: "https://lomas.example.com"
Expand All @@ -144,9 +144,9 @@ dashboard:
enabled: true

image:
repository: dsccadminch/lomas_server
repository: dsccadminch/lomas-raw
imagePullPolicy: Always
tag: latest
tag: sha-3642bd3

config:
# Specified here in case server ingress not managed by this chart.
Expand Down
12 changes: 0 additions & 12 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,11 @@ in
LOMAS_SERVICE_authenticator__oidc_discovery_url = "${config.lomas.oidc.discoveryUrl}";
LOMAS_SERVICE_authenticator__query_userinfo = "${lib.boolToString config.lomas.oidc.queryUserinfo}";

LOMAS_SERVICE_telemetry__enabled = "false";
LOMAS_SERVICE_telemetry__service_name = "lomas-server-app";
LOMAS_SERVICE_telemetry__service_id = "default-host";
LOMAS_SERVICE_telemetry__collector_endpoint = "http://localhost:${toString config.lomas.telemetry.services.otlp.ports.grpc}";
LOMAS_SERVICE_telemetry__collector_insecure = "true";

# Lomas client environment
LOMAS_CLIENT_OIDC_DISCOVERY_URL = config.lomas.oidc.discoveryUrl;
LOMAS_CLIENT_USE_PASSWORD_FLOW = "true";
LOMAS_CLIENT_APP_URL = "http://localhost:${toString config.lomas.port}";

LOMAS_CLIENT_telemetry__enabled = "false";
LOMAS_CLIENT_telemetry__service_name = "lomas-server-app";
LOMAS_CLIENT_telemetry__service_id = "default-host";
LOMAS_CLIENT_telemetry__collector_endpoint = "http://localhost:${toString config.lomas.telemetry.services.otlp.ports.grpc}";
LOMAS_CLIENT_telemetry__collector_insecure = "true";

# Lomas demo setup
LOMAS_ADMIN_server_url = "http://localhost:${toString config.lomas.port}"; # public lomas service url from dashboard
LOMAS_ADMIN_server_service = "http://localhost:${toString config.lomas.port}";
Expand Down
8 changes: 8 additions & 0 deletions devenv/rabbitmq.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ in
description = "RabbitMQ port";
};

prometheusPort = mkOption {
type = types.int;
default = 15692;
description = "RabbitMQ Prometheus metrics TCP port";
};

nodeName = mkOption {
type = types.str;
example = "rabbit@localhost";
Expand Down Expand Up @@ -79,6 +85,7 @@ in
config = mkIf cfg.enable {
services.rabbitmq = {
enable = true;
plugins = [ "rabbitmq_prometheus" ];
listenAddress = cfg.bindAddr;
port = cfg.port;
nodeName = cfg.nodeName;
Expand All @@ -89,6 +96,7 @@ in
configItems = {
default_user = cfg.user;
default_pass = cfg.password;
"prometheus.tcp.port" = toString cfg.prometheusPort;
heartbeat = toString cfg.heartbeat;
"deprecated_features.permit.transient_nonexcl_queues" = "false";
"deprecated_features.permit.management_metrics_collection" = "false";
Expand Down
20 changes: 19 additions & 1 deletion devenv/telemetry.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ in
message = "${service}: must define exactly one of (single) port or (port mapping) ports.";
}) cfg.services;

env = {
LOMAS_SERVICE_telemetry__enabled = "true";
LOMAS_SERVICE_telemetry__service_name = "lomas-server-app";
LOMAS_SERVICE_telemetry__service_id = "default-host";
LOMAS_SERVICE_telemetry__collector_endpoint = "http://localhost:${toString cfg.services.otlp.ports.grpc}";
LOMAS_SERVICE_telemetry__collector_insecure = "true";

LOMAS_CLIENT_telemetry__enabled = "true";
LOMAS_CLIENT_telemetry__service_name = "lomas-server-app";
LOMAS_CLIENT_telemetry__service_id = "default-host";
LOMAS_CLIENT_telemetry__collector_endpoint = "http://localhost:${toString cfg.services.otlp.ports.grpc}";
LOMAS_CLIENT_telemetry__collector_insecure = "true";
};

services.opentelemetry-collector = {
enable = true;
settings = {
Expand Down Expand Up @@ -165,6 +179,10 @@ in
job_name = "loki";
static_configs = [ { targets = [ "localhost:${toString cfg.services.loki.port}" ]; } ];
}
{
job_name = "rabbitmq";
static_configs = [ { targets = [ "localhost:${toString config.lomas.rabbitmq.prometheusPort}" ]; } ];
}
];
};

Expand Down Expand Up @@ -242,7 +260,7 @@ in
[security]
admin_user=admin
admin_password=admin
disable_initial_admin_creation=true
disable_initial_admin_creation=false
'';

dashboardProvision = writeYAML "dashboard.yaml" {
Expand Down
99 changes: 22 additions & 77 deletions server/configs/observability/grafana/example_dashboard_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,10 @@
"links": [],
"liveNow": true,
"panels": [
{
"datasource": {
"type": "tempo",
"uid": "tempo"
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 10,
"options": {
"edges": {},
"nodes": {}
},
"targets": [
{
"datasource": {
"type": "tempo",
"uid": "tempo"
},
"limit": 20,
"query": "{}",
"queryType": "serviceMap",
"refId": "A",
"tableType": "traces"
}
],
"title": "Lomas Node Graph",
"type": "nodeGraph"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -107,7 +75,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "sum by (path) (lomas_server_requests_total{app_name=\"lomas-server-app\"})",
Expand All @@ -123,7 +91,7 @@
{
"datasource": {
"type": "tempo",
"uid": "tempo"
"uid": "P214B5B846CF3925F"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -175,7 +143,7 @@
{
"datasource": {
"type": "tempo",
"uid": "tempo"
"uid": "P214B5B846CF3925F"
},
"limit": 20,
"query": "{name=\"POST /opendp_query\"}",
Expand All @@ -190,7 +158,7 @@
{
"datasource": {
"type": "tempo",
"uid": "tempo"
"uid": "P214B5B846CF3925F"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -242,34 +210,11 @@
{
"datasource": {
"type": "tempo",
"uid": "tempo"
"uid": "P214B5B846CF3925F"
},
"filters": [
{
"id": "0566d0ce",
"operator": "=",
"scope": "span"
},
{
"id": "span-name",
"operator": "=",
"scope": "span",
"tag": "name",
"value": [
"POST /smartnoise_sql_query"
],
"valueType": "string"
}
],
"groupBy": [
{
"id": "f247332f",
"scope": "span"
}
],
"limit": 20,
"query": "{}",
"queryType": "traceqlSearch",
"query": "{ name = \"POST /smartnoise_sql_query\" }",
"queryType": "traceql",
"refId": "A",
"tableType": "traces"
}
Expand Down Expand Up @@ -318,7 +263,7 @@
{
"datasource": {
"type": "tempo",
"uid": "tempo"
"uid": "P214B5B846CF3925F"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -370,10 +315,10 @@
{
"datasource": {
"type": "tempo",
"uid": "tempo"
"uid": "P214B5B846CF3925F"
},
"limit": 20,
"query": "{ span.user_name = \"Dr. Antartica\" }",
"query": "{ span.user_name = \"Dr.Antartica\" }",
"queryType": "traceql",
"refId": "A",
"tableType": "traces"
Expand All @@ -385,7 +330,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -468,7 +413,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"exemplar": true,
Expand All @@ -485,7 +430,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -565,7 +510,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "lomas_server_requests_duration_seconds_sum{}",
Expand All @@ -581,7 +526,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -661,23 +606,23 @@
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "lomas_server_mongodb_query_count_queries_total{instance=\"otel-collector:9090\"}",
"expr": "lomas_server_admindb_query_count_queries_total",
"instant": true,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "MongoDB: Number of queries",
"title": "AdminDB: Number of queries",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -757,10 +702,10 @@
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "lomas_server_admindb_update_count_updates_total{instance=\"otel-collector:9090\"}",
"expr": "lomas_server_admindb_update_count_updates_total",
"instant": true,
"legendFormat": "__auto",
"range": true,
Expand Down
Loading
Loading