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] Call enable Synthetics from Getting started and Add monitor flow #160360

Merged
merged 7 commits into from Jun 27, 2023

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Jun 23, 2023

Summary

Enable synthetics if user visit getting started page or goes to add monitor view and tries to run test manually.

Earlier in above flow synthetics wasn't enabled and it would throw missing API key error.

Testing

  1. Create a fresh cluster
  2. Visit Add monitor page directly
  3. Do a manaul test run , kibana shouldn't throw error that no API key exists

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@shahzad31 shahzad31 changed the title update enablement logic [Synthetics] Call enable Synthetics from Getting started and Add monitor flow Jun 27, 2023
@shahzad31 shahzad31 marked this pull request as ready for review June 27, 2023 09:26
@shahzad31 shahzad31 requested a review from a team as a code owner June 27, 2023 09:26
@paulb-elastic paulb-elastic added the bug Fixes for quality problems that affect the customer experience label Jun 27, 2023
Copy link
Contributor

@awahab07 awahab07 left a comment

Choose a reason for hiding this comment

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

LGTM!

Observations:
When Synthetics API Key is created for the first time (when creating first monitor on main or when visiting Getting Started or Add Monitor page after this PR), some auth exceptions are logged in Kibana console. Also happens on main so this is not related to the changes in the PR.

[2023-06-27T16:07:37.901+02:00][ERROR][plugins.security.authentication] Re-authentication cannot be handled.
[2023-06-27T16:07:37.901+02:00][ERROR][plugins.synthetics] ResponseError: security_exception
	Root causes:
		security_exception: unable to authenticate with provided credentials and anonymous access is not allowed for this request
    at KibanaTransport.request (/Users/abdul.zahid/Desktop/Development/kibana/node_modules/@elastic/transport/src/Transport.ts:535:17)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2023-06-27T16:07:37.901+02:00][ERROR][plugins.synthetics] API key is not valid. Cannot push monitor configuration to synthetics public testing locations
[2023-06-27T16:07:37.902+02:00][WARN ][plugins.security.authenticator] Session is no longer available and cannot be re-authenticated.
[2023-06-27T16:07:37.902+02:00][ERROR][plugins.security.authentication] Re-authentication cannot be handled.
[2023-06-27T16:07:37.902+02:00][INFO ][plugins.security.authentication.api-key] Failed to validate API key: security_exception
	Root causes:
		security_exception: unable to authenticate with provided credentials and anonymous access is not allowed for this request
[2023-06-27T16:07:38.150+02:00][WARN ][plugins.security.authenticator] Session is no longer available and cannot be re-authenticated.
[2023-06-27T16:07:38.151+02:00][ERROR][plugins.security.authentication] Re-authentication cannot be handled.
[2023-06-27T16:07:38.151+02:00][INFO ][plugins.security.authentication.api-key] Failed to validate API key: security_exception
	Root causes:
		security_exception: unable to authenticate with provided credentials and anonymous access is not allowed for this request
[2023-06-27T16:07:38.153+02:00][WARN ][plugins.security.authenticator] Session is no longer available and cannot be re-authenticated.
[2023-06-27T16:07:38.156+02:00][ERROR][plugins.security.authentication] Re-authentication cannot be handled.
[2023-06-27T16:07:38.156+02:00][ERROR][plugins.synthetics] ResponseError: security_exception
	Root causes:
		security_exception: unable to authenticate with provided credentials and anonymous access is not allowed for this request
    at KibanaTransport.request (/Users/abdul.zahid/Desktop/Development/kibana/node_modules/@elastic/transport/src/Transport.ts:535:17)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2023-06-27T16:07:38.182+02:00][WARN ][plugins.security.authenticator] Session is no longer available and cannot be re-authenticated.
[2023-06-27T16:07:38.182+02:00][ERROR][plugins.security.authentication] Re-authentication cannot be handled.
[2023-06-27T16:07:38.182+02:00][ERROR][plugins.synthetics] ResponseError: security_exception
	Root causes:
		security_exception: unable to authenticate with provided credentials and anonymous access is not allowed for this request
    at KibanaTransport.request (/Users/abdul.zahid/Desktop/Development/kibana/node_modules/@elastic/transport/src/Transport.ts:535:17)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2023-06-27T16:07:38.184+02:00][WARN ][plugins.security.authenticator] Session is no longer available and cannot be re-authenticated.
[2023-06-27T16:07:38.185+02:00][ERROR][plugins.security.authentication] Re-authentication cannot be handled.
[2023-06-27T16:07:38.185+02:00][INFO ][plugins.security.authentication.api-key] Failed to validate API key: security_exception
	Root causes:
		security_exception: unable to authenticate with provided credentials and anonymous access is not allowed for this request

@botelastic botelastic bot added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Jun 27, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

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 906.9KB 907.1KB +203.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 413 417 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 492 496 +4
total +6

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@shahzad31 shahzad31 merged commit 58b3c32 into elastic:main Jun 27, 2023
22 checks passed
@shahzad31 shahzad31 deleted the getting-started-enablement branch June 27, 2023 16:18
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 27, 2023
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.9

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 27, 2023
…d monitor flow (#160360) (#160662)

# Backport

This will backport the following commits from `main` to `8.9`:
- [[Synthetics] Call enable Synthetics from Getting started and Add
monitor flow (#160360)](#160360)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT
[{"author":{"name":"Shahzad","email":"shahzad31comp@gmail.com"},"sourceCommit":{"committedDate":"2023-06-27T16:18:19Z","message":"[Synthetics]
Call enable Synthetics from Getting started and Add monitor flow
(#160360)","sha":"58b3c3298f5c024045c0fd1642503857aab82277","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:uptime","v8.9.0","v8.10.0"],"number":160360,"url":"#160360
Call enable Synthetics from Getting started and Add monitor flow
(#160360)","sha":"58b3c3298f5c024045c0fd1642503857aab82277"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"8.9","label":"v8.9.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"#160360
Call enable Synthetics from Getting started and Add monitor flow
(#160360)","sha":"58b3c3298f5c024045c0fd1642503857aab82277"}}]}]
BACKPORT-->

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience release_note:fix Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.9.0 v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants