Skip to content

Commit 446446f

Browse files
committed
fix(mimir): fix mimir multitenency
1 parent fe5fbc6 commit 446446f

File tree

15 files changed

+99
-135
lines changed

15 files changed

+99
-135
lines changed

app/media/MyGrafana/mimir.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: 1
2+
datasources:
3+
- name: Mimir
4+
uid: mimir
5+
type: prometheus
6+
access: proxy
7+
orgId: 1
8+
url: http://mimir-nginx.mimir.svc.cluster.local/prometheus
9+
editable: true
10+
version: 1
11+
jsonData:
12+
httpHeaderName1: X-Scope-OrgID
13+
alertmanagerUid: alertmanager

app/media/MyGrafana/tempo.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

app/models/grafana/mimir_models.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33

44

55

6-
6+
class MultiTenancy(BaseModel):
7+
tenant_name:str = "pods"
8+
79
class MimirInput(BaseModel):
810
name:str = "Mimir"
911
uid:str = "mimir"
1012
url:str = "http://mimir-nginx.mimir.svc.cluster.local/prometheus"
1113
editable: bool = True
1214
httpHeaderName1:str = "X-Scope-OrgID"
1315
alertmanagerUid:str = "alertmanager"
14-
httpHeaderValue1:str = "pods"
16+
multi_tenancy:Optional[MultiTenancy]
1517

16-
18+

app/models/grafana/mysql_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class TLS(BaseModel):
1111

1212
class MysqlInput(BaseModel):
1313
name:str = "MySQL"
14-
url:str = " localhost:3306"
14+
url:str = "localhost:3306"
1515
user:str = "grafana"
1616
editable: bool = True
1717
database:str = "grafana"

app/models/grafana/postgresql_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class PostgresInput(BaseModel):
1010
user:str = "grafana"
1111
editable: bool = True
1212
database:str = "grafana"
13-
sslmode:str = "disable"
13+
sslmode:str = "'disable'"
1414
password:str = "Password!"
1515
maxOpenConns:int = 100
1616
maxIdleConns:int = 100
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
from typing import List, Optional
2-
from pydantic import BaseModel, validator, ValidationError
2+
from pydantic import BaseModel, validator, ValidationError,field_validator
3+
34

45

5-
class TraceID(BaseModel):
6-
datasourceUid:str = "my_jaeger_uid"
7-
name:str = "traceID"
86
class PrometheusInput(BaseModel):
97
name:str = "Prometheus"
108
url:str = "http://localhost:9090"
@@ -13,7 +11,7 @@ class PrometheusInput(BaseModel):
1311
manageAlerts:bool = True
1412
prometheusType:str = "Prometheus"
1513
prometheusVersion:str = "2.44.0"
16-
cacheLevel:str = 'High'
14+
cacheLevel:str = "High"
1715
disableRecordingRules:bool = False
1816
incrementalQueryOverlapWindow:str = "10m"
19-
trace_id: TraceID
17+

app/routes/ansible.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from app.app_instance import app
22
from app.gpt_services import gpt_service
3-
from app.services import (write_installation,edit_directory_generator,execute_pythonfile)
3+
from app.services import (edit_directory_generator,execute_pythonfile)
44
from app.routes.utils import add_files_to_folder
55
from app.models import (AnsibleInstallNginx,AnsibleInstallDocker,Output,AnsibleInstallKuber)
66

app/routes/helm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from app.app_instance import app
22
from app.gpt_services import gpt_service
3-
from app.services import (write_installation,edit_directory_generator,execute_pythonfile)
3+
from app.services import (edit_directory_generator,execute_pythonfile)
44
from app.models import (HelmTemplateGeneration,Output)
55
from app.prompt_generators import (helm_template_generator)
66
import os

app/routes/jcasc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from app.app_instance import app
22
from app.gpt_services import gpt_service
3-
from app.services import (write_installation,edit_directory_generator,execute_pythonfile)
3+
from app.services import (edit_directory_generator,execute_pythonfile)
44
from app.models import (Jcasc,Output)
55
from app.template_generators.jenkins.jcasc import jcasc_template_generator
66
import os

app/routes/terraform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from app.app_instance import app
22
from app.gpt_services import gpt_service
33
from app.services import (
4-
write_installation,
4+
55
edit_directory_generator,execute_pythonfile)
66
from app.models import (IaCBasicInput,
77
IaCBugfixInput,

0 commit comments

Comments
 (0)