Skip to content

Commit 2d6dcb3

Browse files
authored
replace uptime logger name (#226949)
## Summary Follow up PR to this [one](#225570) where loggerName `synthetics` gets replaced with `uptime` To test it enable Uptime through `Stack Management > Advanced Settings` and add following to your `kibana.dev.yml` ``` logging.loggers: - name: elasticsearch.query.myqueries level: debug ``` You should be able to see uptime logs: ``` [2025-07-08T12:24:03.702+03:00][DEBUG][elasticsearch.query.uptime] 200 - 159.0B POST /heartbeat-*/_search {"query":{"bool":{"filter":[{"range":{"@timestamp":{"gte":"now-15m","lte":"now"}}},{"exists":{"field":"summary"}},{"bool":{"must_not":{"exists":{"field":"run_once"}}}}]}},"size":0,"aggs":{"timeseries":{"date_histogram":{"field":"@timestamp","fixed_interval":"36000ms","missing":"0","time_zone":"Europe/Athens"},"aggs":{"down":{"sum":{"field":"summary.down"}},"up":{"sum":{"field":"summary.up"}}}}}} ```
1 parent ae6a3e7 commit 2d6dcb3

9 files changed

Lines changed: 21 additions & 21 deletions

File tree

x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/lib.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('UptimeEsClient', () => {
4343
index: 'heartbeat-*',
4444
...mockSearchParams,
4545
},
46-
{ meta: true, context: { loggingOptions: { loggerName: 'synthetics' } } }
46+
{ meta: true, context: { loggingOptions: { loggerName: 'uptime' } } }
4747
);
4848
expect(result).toEqual({
4949
body: {},
@@ -71,7 +71,7 @@ describe('UptimeEsClient', () => {
7171
index: 'heartbeat-*',
7272
...mockSearchParams,
7373
},
74-
{ meta: true, context: { loggingOptions: { loggerName: 'synthetics' } } }
74+
{ meta: true, context: { loggingOptions: { loggerName: 'uptime' } } }
7575
);
7676
});
7777
});
@@ -86,7 +86,7 @@ describe('UptimeEsClient', () => {
8686

8787
expect(esClient.count).toHaveBeenCalledWith(mockCountParams, {
8888
meta: true,
89-
context: { loggingOptions: { loggerName: 'synthetics' } },
89+
context: { loggingOptions: { loggerName: 'uptime' } },
9090
});
9191
expect(result).toEqual({
9292
indices: 'heartbeat-*',
@@ -112,7 +112,7 @@ describe('UptimeEsClient', () => {
112112
await expect(uptimeEsClient.count(mockCountParams)).rejects.toThrow(mockError);
113113
expect(esClient.count).toHaveBeenCalledWith(mockCountParams, {
114114
meta: true,
115-
context: { loggingOptions: { loggerName: 'synthetics' } },
115+
context: { loggingOptions: { loggerName: 'uptime' } },
116116
});
117117
});
118118
});
@@ -166,7 +166,7 @@ describe('UptimeEsClient', () => {
166166
index: 'heartbeat-*,synthetics-*',
167167
...mockSearchParams,
168168
},
169-
{ meta: true, context: { loggingOptions: { loggerName: 'synthetics' } } }
169+
{ meta: true, context: { loggingOptions: { loggerName: 'uptime' } } }
170170
);
171171
});
172172
it('appends synthetics-* in index for legacy alerts when settings are never saved', async () => {
@@ -195,7 +195,7 @@ describe('UptimeEsClient', () => {
195195
index: 'heartbeat-*,synthetics-*',
196196
...mockSearchParams,
197197
},
198-
{ meta: true, context: { loggingOptions: { loggerName: 'synthetics' } } }
198+
{ meta: true, context: { loggingOptions: { loggerName: 'uptime' } } }
199199
);
200200
});
201201
it('does not append synthetics-* to index for stack version 8.10.0 or later', async () => {
@@ -222,7 +222,7 @@ describe('UptimeEsClient', () => {
222222
match_all: {},
223223
},
224224
},
225-
{ meta: true, context: { loggingOptions: { loggerName: 'synthetics' } } }
225+
{ meta: true, context: { loggingOptions: { loggerName: 'uptime' } } }
226226
);
227227

228228
uptimeEsClient = new UptimeEsClient(savedObjectsClient, esClient, {
@@ -242,7 +242,7 @@ describe('UptimeEsClient', () => {
242242
match_all: {},
243243
},
244244
},
245-
{ meta: true, context: { loggingOptions: { loggerName: 'synthetics' } } }
245+
{ meta: true, context: { loggingOptions: { loggerName: 'uptime' } } }
246246
);
247247
});
248248
});

x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/lib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,6 @@ export function createEsParams<T extends estypes.SearchRequest>(params: T): T {
237237

238238
function getElasticsearchRequestLoggingOptions(): ElasticsearchRequestLoggingOptions {
239239
return {
240-
loggerName: 'synthetics',
240+
loggerName: 'uptime',
241241
};
242242
}

x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_details.test.ts.snap

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ describe('getCerts', () => {
256256
Object {
257257
"context": Object {
258258
"loggingOptions": Object {
259-
"loggerName": "synthetics",
259+
"loggerName": "uptime",
260260
},
261261
},
262262
"meta": true,

x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe('getLatestMonitor', () => {
107107
expect(result?.monitor?.id).toBe('testMonitor');
108108
expect(mockEsClient.search).toHaveBeenCalledWith(expectedGetLatestSearchParams, {
109109
meta: true,
110-
context: { loggingOptions: { loggerName: 'synthetics' } },
110+
context: { loggingOptions: { loggerName: 'uptime' } },
111111
});
112112
});
113113
});

x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ describe('monitor availability', () => {
859859
Object {
860860
"context": Object {
861861
"loggingOptions": Object {
862-
"loggerName": "synthetics",
862+
"loggerName": "uptime",
863863
},
864864
},
865865
"meta": true,

x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_network_events.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ describe('getNetworkEvents', () => {
216216
Object {
217217
"context": Object {
218218
"loggingOptions": Object {
219-
"loggerName": "synthetics",
219+
"loggerName": "uptime",
220220
},
221221
},
222222
"meta": true,

x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ describe('getAll', () => {
166166
Object {
167167
"context": Object {
168168
"loggingOptions": Object {
169-
"loggerName": "synthetics",
169+
"loggerName": "uptime",
170170
},
171171
},
172172
"meta": true,
@@ -231,7 +231,7 @@ describe('getAll', () => {
231231
Object {
232232
"context": Object {
233233
"loggingOptions": Object {
234-
"loggerName": "synthetics",
234+
"loggerName": "uptime",
235235
},
236236
},
237237
"meta": true,
@@ -296,7 +296,7 @@ describe('getAll', () => {
296296
Object {
297297
"context": Object {
298298
"loggingOptions": Object {
299-
"loggerName": "synthetics",
299+
"loggerName": "uptime",
300300
},
301301
},
302302
"meta": true,
@@ -366,7 +366,7 @@ describe('getAll', () => {
366366
Object {
367367
"context": Object {
368368
"loggingOptions": Object {
369-
"loggerName": "synthetics",
369+
"loggerName": "uptime",
370370
},
371371
},
372372
"meta": true,
@@ -477,7 +477,7 @@ describe('getAll', () => {
477477
Object {
478478
"context": Object {
479479
"loggingOptions": Object {
480-
"loggerName": "synthetics",
480+
"loggerName": "uptime",
481481
},
482482
},
483483
"meta": true,

0 commit comments

Comments
 (0)