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

[ObsUX][Infra] Add telemetry for anomaly job creation #198061

Conversation

MiriamAparicio
Copy link
Contributor

@MiriamAparicio MiriamAparicio commented Oct 28, 2024

Closes #189619

Telemetry events created:

  • Infra Anomaly Detection Job Setup
{
  "event_type":"Infra Anomaly Detection Job Setup",
  "context":{...}
  "properties": {
    "job_type":"host",
    "configured_fields":{"start_date":"2024-09-24T16:11:41.446Z","partition_field":"cloud.instance.id","filter_field": "host.name:\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\"}
  }  
}
  • Infra Anomaly Detection Job Date Field Change
{
  "event_type":" Infra Anomaly Detection Job Date Field Change",
  "context":{...}
  "properties": {
    "job_type":"host",
    "start_date":"2024-09-24T16:11:41.446Z"
  }  
}
  • Infra Anomaly Detection Job Partition Field Change
{
  "event_type":" Infra Anomaly Detection Job Date Field Change",
  "context":{...}
  "properties": {
    "job_type":"host",
    "partition_field":"cloud.instance.id"
  }  
}
  • Infra Anomaly Detection Job Filter Field Change
{
  "event_type":" Infra Anomaly Detection Job Date Field Change",
  "context":{...}
  "properties": {
    "job_type":"host",
    "filter_field": "host.name:\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\"
  }  
}

@MiriamAparicio MiriamAparicio added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.16.0 backport:version Backport to applied version labels labels Oct 28, 2024
@MiriamAparicio MiriamAparicio requested a review from a team as a code owner October 28, 2024 17:33
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Oct 28, 2024
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 docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

setPartitionField(value.map((v) => v.label));
telemetry.reportAnomalyDetectionPartitionFieldChange({
job_type: props.jobType,
partition_field: value.length > 0 ? value[0].label : null,
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: Shouldn't the partition_field accept an array in this case? If there is more than 1 label, this will report a incorrect info, wouldn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked again because I thought looking at the code that would be possible, but the UI doesn't let you select more than one, so it's all of them or just one field.
But yeah, it doesn't work as it is (without selecting one), I'll fix it
Thanks for spotting this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After further investigation, I can confirm that is NOT possible to set more than one value for partition_field, I'm unsure why the code treat it as an array though, when we setup the ml module (job) partitionField is string or undefined, you can see the setupModule function in infra/public/containers/ml/infra_ml_module.tsx (I can't link the file because of the incident with the repos)

Still there was an error in the telemetry types as partition_field should be optional, I'll also male filter_field optional

@roshan-elastic
Copy link

Amazing @MiriamAparicio - LGTM!

@elasticmachine
Copy link
Contributor

⏳ Build in-progress

  • Buildkite Build
  • Commit: 403aa63
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-198061-403aa637500f

History

cc @roshan-elastic

@MiriamAparicio MiriamAparicio merged commit 227aaf3 into elastic:main Oct 30, 2024
24 checks passed
@MiriamAparicio MiriamAparicio deleted the 189619-add-telemetry-anomaly-job-creation branch October 30, 2024 20:45
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 30, 2024
Closes elastic#189619

Telemetry events created:

- Infra Anomaly Detection Job Setup
```
{
  "event_type":"Infra Anomaly Detection Job Setup",
  "context":{...}
  "properties": {
    "job_type":"host",
    "configured_fields":{"start_date":"2024-09-24T16:11:41.446Z","partition_field":"cloud.instance.id","filter_field": "host.name:\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\"}
  }
}
```
- Infra Anomaly Detection Job Date Field Change
```
{
  "event_type":" Infra Anomaly Detection Job Date Field Change",
  "context":{...}
  "properties": {
    "job_type":"host",
    "start_date":"2024-09-24T16:11:41.446Z"
  }
}
```
- Infra Anomaly Detection Job Partition Field Change
```
{
  "event_type":" Infra Anomaly Detection Job Date Field Change",
  "context":{...}
  "properties": {
    "job_type":"host",
    "partition_field":"cloud.instance.id"
  }
}
```
- Infra Anomaly Detection Job Filter Field Change
```
{
  "event_type":" Infra Anomaly Detection Job Date Field Change",
  "context":{...}
  "properties": {
    "job_type":"host",
    "filter_field": "host.name:\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\"
  }
}
```

(cherry picked from commit 227aaf3)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.16

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 Oct 30, 2024
#198442)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[ObsUX][Infra] Add telemetry for anomaly job creation
(#198061)](#198061)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT
[{"author":{"name":"Miriam","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-30T20:45:48Z","message":"[ObsUX][Infra]
Add telemetry for anomaly job creation (#198061)\n\nCloses
https://github.com/elastic/kibana/issues/189619\r\n\r\nTelemetry events
created:\r\n\r\n- Infra Anomaly Detection Job Setup\r\n```\r\n{\r\n
\"event_type\":\"Infra Anomaly Detection Job Setup\",\r\n
\"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n
\"configured_fields\":{\"start_date\":\"2024-09-24T16:11:41.446Z\",\"partition_field\":\"cloud.instance.id\",\"filter_field\":
\"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"}\r\n
} \r\n}\r\n```\r\n- Infra Anomaly Detection Job Date Field
Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job
Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n
\"job_type\":\"host\",\r\n
\"start_date\":\"2024-09-24T16:11:41.446Z\"\r\n } \r\n}\r\n```\r\n-
Infra Anomaly Detection Job Partition Field Change\r\n```\r\n{\r\n
\"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n
\"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n
\"partition_field\":\"cloud.instance.id\"\r\n } \r\n}\r\n```\r\n- Infra
Anomaly Detection Job Filter Field Change\r\n```\r\n{\r\n
\"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n
\"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n
\"filter_field\":
\"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"\r\n
}
\r\n}\r\n```","sha":"227aaf3e14448282894bcbc422531a04dd949f4a","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.16.0","backport:version"],"title":"[ObsUX][Infra]
Add telemetry for anomaly job
creation","number":198061,"url":"https://github.com/elastic/kibana/pull/198061","mergeCommit":{"message":"[ObsUX][Infra]
Add telemetry for anomaly job creation (#198061)\n\nCloses
https://github.com/elastic/kibana/issues/189619\r\n\r\nTelemetry events
created:\r\n\r\n- Infra Anomaly Detection Job Setup\r\n```\r\n{\r\n
\"event_type\":\"Infra Anomaly Detection Job Setup\",\r\n
\"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n
\"configured_fields\":{\"start_date\":\"2024-09-24T16:11:41.446Z\",\"partition_field\":\"cloud.instance.id\",\"filter_field\":
\"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"}\r\n
} \r\n}\r\n```\r\n- Infra Anomaly Detection Job Date Field
Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job
Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n
\"job_type\":\"host\",\r\n
\"start_date\":\"2024-09-24T16:11:41.446Z\"\r\n } \r\n}\r\n```\r\n-
Infra Anomaly Detection Job Partition Field Change\r\n```\r\n{\r\n
\"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n
\"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n
\"partition_field\":\"cloud.instance.id\"\r\n } \r\n}\r\n```\r\n- Infra
Anomaly Detection Job Filter Field Change\r\n```\r\n{\r\n
\"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n
\"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n
\"filter_field\":
\"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"\r\n
}
\r\n}\r\n```","sha":"227aaf3e14448282894bcbc422531a04dd949f4a"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198061","number":198061,"mergeCommit":{"message":"[ObsUX][Infra]
Add telemetry for anomaly job creation (#198061)\n\nCloses
https://github.com/elastic/kibana/issues/189619\r\n\r\nTelemetry events
created:\r\n\r\n- Infra Anomaly Detection Job Setup\r\n```\r\n{\r\n
\"event_type\":\"Infra Anomaly Detection Job Setup\",\r\n
\"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n
\"configured_fields\":{\"start_date\":\"2024-09-24T16:11:41.446Z\",\"partition_field\":\"cloud.instance.id\",\"filter_field\":
\"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"}\r\n
} \r\n}\r\n```\r\n- Infra Anomaly Detection Job Date Field
Change\r\n```\r\n{\r\n \"event_type\":\" Infra Anomaly Detection Job
Date Field Change\",\r\n \"context\":{...}\r\n \"properties\": {\r\n
\"job_type\":\"host\",\r\n
\"start_date\":\"2024-09-24T16:11:41.446Z\"\r\n } \r\n}\r\n```\r\n-
Infra Anomaly Detection Job Partition Field Change\r\n```\r\n{\r\n
\"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n
\"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n
\"partition_field\":\"cloud.instance.id\"\r\n } \r\n}\r\n```\r\n- Infra
Anomaly Detection Job Filter Field Change\r\n```\r\n{\r\n
\"event_type\":\" Infra Anomaly Detection Job Date Field Change\",\r\n
\"context\":{...}\r\n \"properties\": {\r\n \"job_type\":\"host\",\r\n
\"filter_field\":
\"host.name:\\\"gke-edge-lite-oblt-edge-lite-oblt-poo-f77db573-2249\\\"\r\n
}
\r\n}\r\n```","sha":"227aaf3e14448282894bcbc422531a04dd949f4a"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Miriam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Infra] Add telemetry to anomaly job creation
6 participants