Skip to content

Commit

Permalink
[Infrastructure UI] Track host cloud provider on table entry click (e…
Browse files Browse the repository at this point in the history
…lastic#150685)

## 📓 Summary

Closes elastic#150681

The tracked event when clicking an entry from the Hosts table was not
applying correctly the default `unknow` string for the `cloud_provider`
parameter.
Now it defaults to it in case the value is not passed or is null.

## 🧪 Testing
- Navigate to the Hosts view
- Open the console dev tools
- Click on a host name from the table and navigate to the host detail.
- Verify the following error does not appear in the log
```
Uncaught Error: Failed to validate payload coming from "Event Type 'Host Entry Clicked'":
[cloud_provider]: {"expected":"string","actual":"object","value":null}
```

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
(cherry picked from commit 26eddec)
  • Loading branch information
tonyghiani committed Feb 9, 2023
1 parent 5cc66cb commit 3316ae4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export class TelemetryClient implements ITelemetryClient {

public reportHostEntryClicked = ({
hostname,
cloud_provider: cloudProvider = 'unknown',
cloud_provider: cloudProvider,
}: HostEntryClickedParams) => {
this.analytics.reportEvent(InfraTelemetryEventTypes.HOSTS_ENTRY_CLICKED, {
hostname,
cloud_provider: cloudProvider,
cloud_provider: cloudProvider ?? 'unknown',
});
};

Expand Down

0 comments on commit 3316ae4

Please sign in to comment.