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

[Infrastructure UI] Add network in/out to Hosts View Table #139316

Closed
neptunian opened this issue Aug 23, 2022 · 14 comments · Fixed by #142137
Closed

[Infrastructure UI] Add network in/out to Hosts View Table #139316

neptunian opened this issue Aug 23, 2022 · 14 comments · Fixed by #142137
Assignees
Labels
Epic: Host Observability Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services

Comments

@neptunian
Copy link
Contributor

neptunian commented Aug 23, 2022

Implement Network traffic in Hosts table via Lens formula. Instead of the single column NW Traffic as shown in the screenshot below, use two separate columns to calculate Inbound(rx) and Outbound(tx) traffic so the user can sort by either field. The column names should be RX (avg.) and TX (avg.).

Screen Shot 2022-09-26 at 9 48 05 AM

#141372 added support for calculating bits.

We want to calculate bits per second. The values should be something like 100Mbit/s, 2Gbit/s, etc. The fields used are host.network.ingress.bytes and host.network.egress.bytes. To see how we calculate bits per second with a gauge field in other places see #134471 (comment)

@neptunian neptunian added the Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services label Aug 23, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@ghudgins
Copy link

ghudgins commented Aug 24, 2022

hey @elastic/kibana-vis-editors - as far as a workaround for the linked issue: once ad hoc data views is merged (expected for 8.5)...I believe they can work around this by using an Ad Hoc data view (by value) and a field formatter leveraging numeral.js to get that pattern. Can you confirm?

edit: I played a bit and realized we don't allow the suffix at the same time as the "Default" numeral.js patterns. will discuss with the team

@neptunian
Copy link
Contributor Author

neptunian commented Aug 26, 2022

Note: here is how Infra UI handles bit formatting:
https://github.com/elastic/kibana/blob/main/x-pack/plugins/infra/common/formatters/bytes.ts

@flash1293
Copy link
Contributor

flash1293 commented Aug 29, 2022

We could add a new entry to the list of Lens format overrides for bit formatting:
Screenshot 2022-08-29 at 10 16 41

As the underlying numeral.js formatting already supports this, it should be easy to add. What do you think @ghudgins ?

@neptunian
Copy link
Contributor Author

@ghudgins Is it possible this could be available for us to use before the 8.6 FF? :)

@ghudgins
Copy link

we're doing planning this week but we do have this on the list for 8.6 - #139639

we'll make sure it happens as early as we can before FF

@smith smith added the blocked label Sep 21, 2022
@smith
Copy link
Contributor

smith commented Sep 23, 2022

Looks like #141372 unblocks this.

@smith smith removed the blocked label Sep 23, 2022
@flash1293
Copy link
Contributor

Let us know in case something isn’t working right - still very easy to do changes at this point

@neptunian neptunian self-assigned this Sep 27, 2022
@simianhacker
Copy link
Member

simianhacker commented Sep 28, 2022

@flash1293 When using the bits (1000) formatter, is the assumption the input is in bytes or bits? If it's in bytes, just dividing by 1000 doesn't convert it to kilobits, that would give you kilobytes; dividing by 1024 gives you kibibytes. To convert from bytes to bits you would first need to multiply by 8 and then if you wanted kilobits you would divide by 1000; kibibits you would divide by 1024.

From my research, the difference in using 1000 vs 1024 is metric vs binary.

All this is based on my interpretation of from these Wikipedia articles:

(let me know if I'm misinterpreting all of this as well)

@flash1293
Copy link
Contributor

It’s interpreting the input as bits already, the formatter is just taking care of the kilo/mega/… suffix. So if the raw field in the document is bytes, then you need to multiply by 8 (you can do this via formula)..

The “(1000)” signifies that it’s doing kilobits, not kibibits.

@flash1293
Copy link
Contributor

If you are using formula, you can do the “normalize by unit” as part of the formula using the respective function (I think it’s called normalize_by_unit)

@simianhacker
Copy link
Member

simianhacker commented Sep 28, 2022

So really the distinction is bits (1000) is formatting using base 10 for abbreviating bits and bytes (1024) is formatting by base 2 for abbreviating bytes. I'm not sure what the correct label should be for that but my fear is that when people see bits (1000) they might think "I want to see this number, which might be a byte, in bits".

I feel like there really should be 4 formatters:

  1. bits (1000) 1000 bits would be 1 kbit
  2. bits (1024) 1000 bits would be 0.98 Kibit
  3. bytes (1000) 1000 bytes would be 1 kB
  4. bytes (1024) 1000 bytes would be 0.98 KiB

@flash1293
Copy link
Contributor

Yeah, I see your point. We don't want to add too many options to this list because we plan to rewrite the way formatting is defined anyway (the bits extension was done specifically for this use case).

@simianhacker
Copy link
Member

@flash1293 I think for this specific use case, bits (1000) is really all they need. Also knowing the expected input should be converted from bytes to bits was the missing piece.

Since the formatting is being refactor, the above is something to keep in mind when formatting "data".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic: Host Observability Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants