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

feat(slo): Add timestampField additional settings #153395

Merged
merged 12 commits into from
Mar 23, 2023

Conversation

kdelemme
Copy link
Contributor

@kdelemme kdelemme commented Mar 21, 2023

Summary

Resolves #153397

This PR adds the timestampField's additional settings in the create/edit SLO form.

While working on this, I noticed that we were using the settings.timestampField in all transforms, with a @timestamp default value if not provided.
This could lead to potential issue as APM data are always ingested using @timestamp field, therefore, the timestampField needed to become a custom KQL indicator specificities, and should not be overridable for APM indicator types.

Therefore, I've moved the settings.timestampField to the custom KQL indicator.params as an optional field. When not provided, or empty (""), the transform uses @timestamp.
APM transforms have been changed to always use @timestamp.

Finally, I've updated the OpenAPI documentation as well as the dev docs.

🧪 Manual testing

From the API
curl --request POST \
  --url http://localhost:5601/kibana/api/observability/slos \
  --header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' \
  --header 'Content-Type: application/json' \
  --header 'kbn-xsrf: oui' \
  --data '{
	"name": "latency logs service",
	"description": "latency from logs",
	"indicator": {
		"type": "sli.kql.custom",
		"params": {
			"index": "service-logs-latency*",
			"good": "latency < 150",
			"total": "",
			"filter": "",
			"timestampField": "my_timestamp"
		}
	},
	"timeWindow": {
		"duration": "30d",
		"isRolling": true
	},
	"budgetingMethod": "occurrences",
	"objective": {
		"target": 0.98
	}
}'
  • ✅ Check the transform is created with the correct my_timestamp field
From the UI

Create a custom KQL SLO and override (and not) the timestampField under the additional settings.

  • ✅ Check the transform is created with the provided timestampField
  • ✅ Check the transform is created with the default @timestamp when not overridden

@kdelemme kdelemme self-assigned this Mar 21, 2023
@kdelemme kdelemme added v8.8.0 Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" release_note:skip Skip the PR/issue when compiling release notes labels Mar 21, 2023
@kdelemme kdelemme marked this pull request as ready for review March 21, 2023 20:30
@kdelemme kdelemme requested a review from a team as a code owner March 21, 2023 20:30
@elasticmachine
Copy link
Contributor

Pinging @elastic/actionable-observability (Team: Actionable Observability)

Copy link
Contributor

@CoenWarmer CoenWarmer left a comment

Choose a reason for hiding this comment

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

Tested, works as expected. LGTM!

@kdelemme kdelemme requested a review from a team as a code owner March 22, 2023 12:20
Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

SO mapping changes LGTM

@kdelemme kdelemme enabled auto-merge (squash) March 23, 2023 13:15
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observability 512 513 +1

Async chunks

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

id before after diff
observability 1.1MB 1.1MB +1.2KB

Saved Objects .kibana field count

Every field in each saved object type adds overhead to Elasticsearch. Kibana needs to keep the total field count below Elasticsearch's default limit of 1000 fields. Only specify field mappings for the fields you wish to search on or query. See https://www.elastic.co/guide/en/kibana/master/saved-objects-service.html#_mappings

id before after diff
slo 26 25 -1
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 433 436 +3

Total ESLint disabled count

id before after diff
securitySolution 513 516 +3

History

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

cc @kdelemme

@kdelemme kdelemme merged commit c0453af into elastic:main Mar 23, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Mar 23, 2023
@kdelemme kdelemme deleted the feat/add-additional-index-option branch March 23, 2023 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SLO] Add timestampField additional settings in form
6 participants