Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Synthetics] Fix tls alert data !! #212758

Merged
merged 3 commits into from
Mar 5, 2025
Merged

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Feb 28, 2025

Summary

This PR improves and fixes the TLS alert data handling in the Synthetics plugin. Key updates include:

Code changes

  1. Request Body Updates:

    • Added agent.name.
    • Changed optional chaining to direct property access for ping.monitor.name, ping.monitor.id, and ping.observer.name.
    • Added ping.agent.name.
  2. Cert Type Adjustments:

    • Added fields: monitorName, monitorId, monitorType, locationId, locationName, @timestamp, hostName.
  3. Observer Codec:

    • Ensured name and geo.name are required fields.
  4. Monitor Type and Ping Type:

    • Added name to MonitorType.
    • Moved @timestamp to required fields in PingType.
  5. Message Utils:

    • Adjusted getCertSummary and getTLSAlertDocument so that we can properly generate alert document

@shahzad31 shahzad31 marked this pull request as ready for review February 28, 2025 15:00
@shahzad31 shahzad31 requested a review from a team as a code owner February 28, 2025 15:00
@shahzad31 shahzad31 added v9.0.0 backport:version Backport to applied version labels v8.18.0 release_note:skip Skip the PR/issue when compiling release notes labels Feb 28, 2025
@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Mar 4, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to work ok, but I did note that I can't edit the TLS rule in the management page.

image

Discussed this with @shahzad31 offline, will wait for him to fix this and then this should be ready.

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
synthetics 790.9KB 791.0KB +81.0B

History

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shahzad31 shahzad31 merged commit 80f4aab into elastic:main Mar 5, 2025
9 checks passed
@shahzad31 shahzad31 deleted the tls-alerts-data branch March 5, 2025 18:40
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 9.0

https://github.com/elastic/kibana/actions/runs/13683146892

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.18 Backport failed because of merge conflicts
9.0 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 212758

Questions ?

Please refer to the Backport tool documentation

shahzad31 added a commit to shahzad31/kibana that referenced this pull request Mar 6, 2025
### Summary
This PR improves and fixes the TLS alert data handling in the Synthetics
plugin. Key updates include:

### Code changes

1. **Request Body Updates**:
   - Added `agent.name`.
- Changed optional chaining to direct property access for
`ping.monitor.name`, `ping.monitor.id`, and `ping.observer.name`.
   - Added `ping.agent.name`.

2. **Cert Type Adjustments**:
- Added fields: `monitorName`, `monitorId`, `monitorType`, `locationId`,
`locationName`, `@timestamp`, `hostName`.

3. **Observer Codec**:
   - Ensured `name` and `geo.name` are required fields.

4. **Monitor Type and Ping Type**:
   - Added `name` to `MonitorType`.
   - Moved `@timestamp` to required fields in `PingType`.

7. **Message Utils**:
- Adjusted `getCertSummary` and `getTLSAlertDocument` so that we can
properly generate alert document

(cherry picked from commit 80f4aab)

# Conflicts:
#	x-pack/solutions/observability/plugins/synthetics/common/requests/get_certs_request_body.ts
@shahzad31
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.0
8.18

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@shahzad31 shahzad31 added backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) backport:prev-major Backport to (8.x, 8.18, 8.17, 8.16) the previous major branch and other branches in development and removed backport:version Backport to applied version labels labels Mar 6, 2025
shahzad31 added a commit to shahzad31/kibana that referenced this pull request Mar 6, 2025
### Summary
This PR improves and fixes the TLS alert data handling in the Synthetics
plugin. Key updates include:

### Code changes

1. **Request Body Updates**:
   - Added `agent.name`.
- Changed optional chaining to direct property access for
`ping.monitor.name`, `ping.monitor.id`, and `ping.observer.name`.
   - Added `ping.agent.name`.

2. **Cert Type Adjustments**:
- Added fields: `monitorName`, `monitorId`, `monitorType`, `locationId`,
`locationName`, `@timestamp`, `hostName`.

3. **Observer Codec**:
   - Ensured `name` and `geo.name` are required fields.

4. **Monitor Type and Ping Type**:
   - Added `name` to `MonitorType`.
   - Moved `@timestamp` to required fields in `PingType`.

7. **Message Utils**:
- Adjusted `getCertSummary` and `getTLSAlertDocument` so that we can
properly generate alert document

(cherry picked from commit 80f4aab)

# Conflicts:
#	x-pack/solutions/observability/plugins/synthetics/common/requests/get_certs_request_body.ts
#	x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/types.ts
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.17, 8.18, 8.x, 9.0

https://github.com/elastic/kibana/actions/runs/13693402630

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.17, 8.18, 8.x, 9.0

https://github.com/elastic/kibana/actions/runs/13693402636

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.16 Backport failed because of merge conflicts
8.17 Backport failed because of merge conflicts
8.18 Backport failed because of merge conflicts
8.x Backport failed because of merge conflicts
9.0 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 212758

Questions ?

Please refer to the Backport tool documentation

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.16 Backport failed because of merge conflicts
8.17 Backport failed because of merge conflicts
8.18 Backport failed because of merge conflicts
8.x Backport failed because of merge conflicts
9.0 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 212758

Questions ?

Please refer to the Backport tool documentation

@shahzad31
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

shahzad31 added a commit to shahzad31/kibana that referenced this pull request Mar 6, 2025
### Summary
This PR improves and fixes the TLS alert data handling in the Synthetics
plugin. Key updates include:

### Code changes

1. **Request Body Updates**:
   - Added `agent.name`.
- Changed optional chaining to direct property access for
`ping.monitor.name`, `ping.monitor.id`, and `ping.observer.name`.
   - Added `ping.agent.name`.

2. **Cert Type Adjustments**:
- Added fields: `monitorName`, `monitorId`, `monitorType`, `locationId`,
`locationName`, `@timestamp`, `hostName`.

3. **Observer Codec**:
   - Ensured `name` and `geo.name` are required fields.

4. **Monitor Type and Ping Type**:
   - Added `name` to `MonitorType`.
   - Moved `@timestamp` to required fields in `PingType`.

7. **Message Utils**:
- Adjusted `getCertSummary` and `getTLSAlertDocument` so that we can
properly generate alert document

(cherry picked from commit 80f4aab)

# Conflicts:
#	x-pack/solutions/observability/plugins/synthetics/common/requests/get_certs_request_body.ts
#	x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/types.ts
shahzad31 added a commit that referenced this pull request Mar 6, 2025
# Backport

This will backport the following commits from `main` to `8.18`:
- [[Synthetics] Fix tls alert data !!
(#212758)](#212758)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT
[{"author":{"name":"Shahzad","email":"shahzad31comp@gmail.com"},"sourceCommit":{"committedDate":"2025-03-05T18:40:04Z","message":"[Synthetics]
Fix tls alert data !! (#212758)\n\n### Summary\nThis PR improves and
fixes the TLS alert data handling in the Synthetics\nplugin. Key updates
include:\n\n\n### Code changes\n\n1. **Request Body Updates**:\n - Added
`agent.name`.\n- Changed optional chaining to direct property access
for\n`ping.monitor.name`, `ping.monitor.id`, and `ping.observer.name`.\n
- Added `ping.agent.name`.\n\n2. **Cert Type Adjustments**:\n- Added
fields: `monitorName`, `monitorId`, `monitorType`,
`locationId`,\n`locationName`, `@timestamp`, `hostName`.\n\n3.
**Observer Codec**:\n - Ensured `name` and `geo.name` are required
fields.\n\n4. **Monitor Type and Ping Type**:\n - Added `name` to
`MonitorType`.\n - Moved `@timestamp` to required fields in
`PingType`.\n\n7. **Message Utils**:\n- Adjusted `getCertSummary` and
`getTLSAlertDocument` so that we can\nproperly generate alert
document","sha":"80f4aab305eb90646f418bc704423308d133d7d2","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-management","backport:version","v8.18.0","v9.1.0"],"title":"[Synthetics]
Fix tls alert data
!!","number":212758,"url":"https://github.com/elastic/kibana/pull/212758","mergeCommit":{"message":"[Synthetics]
Fix tls alert data !! (#212758)\n\n### Summary\nThis PR improves and
fixes the TLS alert data handling in the Synthetics\nplugin. Key updates
include:\n\n\n### Code changes\n\n1. **Request Body Updates**:\n - Added
`agent.name`.\n- Changed optional chaining to direct property access
for\n`ping.monitor.name`, `ping.monitor.id`, and `ping.observer.name`.\n
- Added `ping.agent.name`.\n\n2. **Cert Type Adjustments**:\n- Added
fields: `monitorName`, `monitorId`, `monitorType`,
`locationId`,\n`locationName`, `@timestamp`, `hostName`.\n\n3.
**Observer Codec**:\n - Ensured `name` and `geo.name` are required
fields.\n\n4. **Monitor Type and Ping Type**:\n - Added `name` to
`MonitorType`.\n - Moved `@timestamp` to required fields in
`PingType`.\n\n7. **Message Utils**:\n- Adjusted `getCertSummary` and
`getTLSAlertDocument` so that we can\nproperly generate alert
document","sha":"80f4aab305eb90646f418bc704423308d133d7d2"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212758","number":212758,"mergeCommit":{"message":"[Synthetics]
Fix tls alert data !! (#212758)\n\n### Summary\nThis PR improves and
fixes the TLS alert data handling in the Synthetics\nplugin. Key updates
include:\n\n\n### Code changes\n\n1. **Request Body Updates**:\n - Added
`agent.name`.\n- Changed optional chaining to direct property access
for\n`ping.monitor.name`, `ping.monitor.id`, and `ping.observer.name`.\n
- Added `ping.agent.name`.\n\n2. **Cert Type Adjustments**:\n- Added
fields: `monitorName`, `monitorId`, `monitorType`,
`locationId`,\n`locationName`, `@timestamp`, `hostName`.\n\n3.
**Observer Codec**:\n - Ensured `name` and `geo.name` are required
fields.\n\n4. **Monitor Type and Ping Type**:\n - Added `name` to
`MonitorType`.\n - Moved `@timestamp` to required fields in
`PingType`.\n\n7. **Message Utils**:\n- Adjusted `getCertSummary` and
`getTLSAlertDocument` so that we can\nproperly generate alert
document","sha":"80f4aab305eb90646f418bc704423308d133d7d2"}}]}]
BACKPORT-->
shahzad31 added a commit that referenced this pull request Mar 6, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Synthetics] Fix tls alert data !!
(#212758)](#212758)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT
[{"author":{"name":"Shahzad","email":"shahzad31comp@gmail.com"},"sourceCommit":{"committedDate":"2025-03-05T18:40:04Z","message":"[Synthetics]
Fix tls alert data !! (#212758)\n\n### Summary\nThis PR improves and
fixes the TLS alert data handling in the Synthetics\nplugin. Key updates
include:\n\n\n### Code changes\n\n1. **Request Body Updates**:\n - Added
`agent.name`.\n- Changed optional chaining to direct property access
for\n`ping.monitor.name`, `ping.monitor.id`, and `ping.observer.name`.\n
- Added `ping.agent.name`.\n\n2. **Cert Type Adjustments**:\n- Added
fields: `monitorName`, `monitorId`, `monitorType`,
`locationId`,\n`locationName`, `@timestamp`, `hostName`.\n\n3.
**Observer Codec**:\n - Ensured `name` and `geo.name` are required
fields.\n\n4. **Monitor Type and Ping Type**:\n - Added `name` to
`MonitorType`.\n - Moved `@timestamp` to required fields in
`PingType`.\n\n7. **Message Utils**:\n- Adjusted `getCertSummary` and
`getTLSAlertDocument` so that we can\nproperly generate alert
document","sha":"80f4aab305eb90646f418bc704423308d133d7d2","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","backport:prev-major","Team:obs-ux-management","v8.18.0","v9.1.0"],"title":"[Synthetics]
Fix tls alert data
!!","number":212758,"url":"https://github.com/elastic/kibana/pull/212758","mergeCommit":{"message":"[Synthetics]
Fix tls alert data !! (#212758)\n\n### Summary\nThis PR improves and
fixes the TLS alert data handling in the Synthetics\nplugin. Key updates
include:\n\n\n### Code changes\n\n1. **Request Body Updates**:\n - Added
`agent.name`.\n- Changed optional chaining to direct property access
for\n`ping.monitor.name`, `ping.monitor.id`, and `ping.observer.name`.\n
- Added `ping.agent.name`.\n\n2. **Cert Type Adjustments**:\n- Added
fields: `monitorName`, `monitorId`, `monitorType`,
`locationId`,\n`locationName`, `@timestamp`, `hostName`.\n\n3.
**Observer Codec**:\n - Ensured `name` and `geo.name` are required
fields.\n\n4. **Monitor Type and Ping Type**:\n - Added `name` to
`MonitorType`.\n - Moved `@timestamp` to required fields in
`PingType`.\n\n7. **Message Utils**:\n- Adjusted `getCertSummary` and
`getTLSAlertDocument` so that we can\nproperly generate alert
document","sha":"80f4aab305eb90646f418bc704423308d133d7d2"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/213315","number":213315,"state":"OPEN"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/213317","number":213317,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212758","number":212758,"mergeCommit":{"message":"[Synthetics]
Fix tls alert data !! (#212758)\n\n### Summary\nThis PR improves and
fixes the TLS alert data handling in the Synthetics\nplugin. Key updates
include:\n\n\n### Code changes\n\n1. **Request Body Updates**:\n - Added
`agent.name`.\n- Changed optional chaining to direct property access
for\n`ping.monitor.name`, `ping.monitor.id`, and `ping.observer.name`.\n
- Added `ping.agent.name`.\n\n2. **Cert Type Adjustments**:\n- Added
fields: `monitorName`, `monitorId`, `monitorType`,
`locationId`,\n`locationName`, `@timestamp`, `hostName`.\n\n3.
**Observer Codec**:\n - Ensured `name` and `geo.name` are required
fields.\n\n4. **Monitor Type and Ping Type**:\n - Added `name` to
`MonitorType`.\n - Moved `@timestamp` to required fields in
`PingType`.\n\n7. **Message Utils**:\n- Adjusted `getCertSummary` and
`getTLSAlertDocument` so that we can\nproperly generate alert
document","sha":"80f4aab305eb90646f418bc704423308d133d7d2"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-major Backport to (8.x, 8.18, 8.17, 8.16) the previous major branch and other branches in development backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.18.0 v8.19.0 v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants