Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite448d84

Browse files
Changed sql in postgres_reports.py to lowercase
1 parentf069a2f commite448d84

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎reporter/postgres_reports.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
classPostgresReportGenerator:
2222
def__init__(self,prometheus_url:str="http://sink-prometheus:9090",
23-
postgres_sink_url:str="postgresql://pgwatch:pgwatchadmin@sink-postgres:5432/measurements"):
23+
postgres_sink_url:str="postgresql://pgwatch@sink-postgres:5432/measurements"):
2424
"""
2525
Initialize the PostgreSQL report generator.
2626
2727
Args:
2828
prometheus_url: URL of the Prometheus instance (default: http://sink-prometheus:9090)
2929
postgres_sink_url: Connection string for the Postgres sink database
30-
(default: postgresql://pgwatch:pgwatchadmin@sink-postgres:5432/measurements)
30+
(default: postgresql://pgwatch@sink-postgres:5432/measurements)
3131
"""
3232
self.prometheus_url=prometheus_url
3333
self.base_url=f"{prometheus_url}/api/v1"
@@ -78,12 +78,12 @@ def get_index_definitions_from_sink(self) -> Dict[str, str]:
7878
withself.pg_conn.cursor(cursor_factory=psycopg2.extras.DictCursor)ascursor:
7979
# Query the index_definitions table for the most recent data
8080
query="""
81-
SELECT DISTINCT ON (data->>'indexrelname')
81+
select distinct on (data->>'indexrelname')
8282
data->>'indexrelname' as indexrelname,
8383
data->>'index_definition' as index_definition
84-
FROM public.index_definitions
85-
WHERE data ? 'indexrelname'AND data ? 'index_definition'
86-
ORDER BY data->>'indexrelname', timeDESC
84+
from public.index_definitions
85+
where data ? 'indexrelname'and data ? 'index_definition'
86+
order by data->>'indexrelname', timedesc
8787
"""
8888
cursor.execute(query)
8989

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp