[8.19] [Stack Monitoring] Fix Recent Log Entries timezone (#249016)#249112
Merged
kibanamachine merged 1 commit intoelastic:8.19from Jan 15, 2026
Merged
[8.19] [Stack Monitoring] Fix Recent Log Entries timezone (#249016)#249112kibanamachine merged 1 commit intoelastic:8.19from
kibanamachine merged 1 commit intoelastic:8.19from
Conversation
Closes elastic#120292 ## Summary The Stack Monitoring **Recent Log Entries** table now respects the Kibana `dateFormat:tz` advanced setting. ## Details - Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of `Browser`/`null`/unset as the browser-guessed timezone - Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as expected - Adds unit tests covering explicit timezone, `Browser`, and default/unset behavior ## Demo Current locale is UTC+1 (value should be 2:26) ### Before <img width="1718" height="1407" alt="SCR-20260114-myjp" src="https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868" /> ### After <img width="1720" height="1408" alt="SCR-20260114-mymj" src="https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378" /> ## Test plan - `node scripts/jest x-pack/platform/plugins/private/monitoring/common/formatting.test.ts` - Manual: change **Stack Management → Advanced Settings → Time zone (`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates ## Manual test data (optional) If you don't already have Stack Monitoring data available locally, you can create a minimal set of documents via **Kibana → Dev Tools → Console**. Pick values for: - `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z` - `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324` Then run: 1) Create a minimal cluster stats doc (note the `timestamp` field): ```http POST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for { "@timestamp": "<ISO_TIMESTAMP>", "timestamp": <EPOCH_MS>, "type": "cluster_stats", "metricset": { "name": "cluster_stats" }, "data_stream": { "type": "metrics", "dataset": "elasticsearch.stack_monitoring.cluster_stats", "namespace": "default" }, "cluster_uuid": "tz-test-cluster", "cluster_name": "tz-test-cluster", "license": { "status": "active", "type": "trial", "expiry_date_in_millis": 1894665600000 } } ``` 2) Create a minimal Elasticsearch server log doc for the same cluster: ```http POST logs-elasticsearch.server-default/_doc?refresh=wait_for { "@timestamp": "<ISO_TIMESTAMP>", "message": "TZ regression test log entry - should show in browser timezone", "service": { "type": "elasticsearch" }, "event": { "dataset": "elasticsearch.server" }, "log": { "level": "INFO" }, "elasticsearch": { "cluster": { "uuid": "tz-test-cluster" }, "node": { "name": "test-node-1" }, "component": "test-component" } } ``` 3) In Kibana: - Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g. **Last 15 minutes** if you used “now - 5m”) - Go to **Stack Monitoring → Elasticsearch → Overview** and confirm **Recent Log Entries** shows the row - Flip **Stack Management → Advanced Settings → Time zone (`dateFormat:tz`)** between `Browser` and `UTC` and confirm the displayed timestamp shifts accordingly 4) Cleanup (optional): ```http POST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true { "query": { "term": { "cluster_uuid": "tz-test-cluster" } } } ``` ```http POST logs-elasticsearch.*-*/_delete_by_query?refresh=true { "query": { "term": { "elasticsearch.cluster.uuid": "tz-test-cluster" } } } ``` # Release Note Fix Stack Monitoring Recent Log Entries timestamps to respect Kibana's time zone setting (`dateFormat:tz`). (cherry picked from commit 67cefd4)
Contributor
💔 Build Failed
Failed CI Stepscc @kapral18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation