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

Track low memory events #283

Open
bidetofevil opened this issue Mar 19, 2024 · 6 comments
Open

Track low memory events #283

bidetofevil opened this issue Mar 19, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@bidetofevil
Copy link
Contributor

Android's ComponentCallback2 interface allows for the app to listen for OS-level memory events that tell the app the process is trying to recover memory. Surfacing these warnings/alerts (as Events?) could be useful as it could be an indication the app is running low on resources so performance could be hampered.

@marandaneto
Copy link
Member

It's worth adding a min. level configuration since not all levels are critical.
Also, worth adding a deboucer since this can be super noisy.
https://developer.android.com/topic/performance/memory

@breedx-splk breedx-splk added the enhancement New feature or request label Mar 20, 2024
@breedx-splk
Copy link
Contributor

I think this is a great idea. Contributions for this are very much welcome!

@aldoKelvianto
Copy link

I think this is a great idea as well! We can monitor when the app is running on low memory and identify the exact time when it happens.

However, I'm still not sure where to put this event in the context of OpenTelemetry Signals. We can put the low memory event as:

  1. Span Event

  2. Event in Log

I'm leaning towards using a Span Event, since we can get the full picture of the app's events by looking at Spans in the Trace.

What do you guys think?

@bidetofevil
Copy link
Contributor Author

What signal is appropriate depends entirely on how sessions or being modelled in the app/library that is capturing the telemetry. For instance, in the Embrace SDK, this will be SpanEvent attached to the specific span we use to model a session, but this may not be appropriate for everyone.

The new Events signal seems to make the most sense to me in the long term - certainly a semconv that is attached to an Event makes sense.

In the context of this project, @breedx-splk probably has the best insight as to how best to model it, either now or in the future.

@breedx-splk
Copy link
Contributor

Yeah, I agree with @bidetofevil that Events will be the way to model this. One way to tell is that the title of this issue even has the word "event" in it, and we think about these low memory points as events. 😄

I believe the latest core java sdk release has the updated API that matches changes to the spec and semconv, and will allow rich objects in event payload bodies. Would be great to see what an implementation of these would look like, with respect to low memory.

@aldoKelvianto
Copy link

Cool! I just found out that Events support is already on development (Event API Interface, Semantic Convention for Events), thanks 🙌

One way to tell is that the title of this issue even has the word "event" in it, and we think about these low memory points as events. 😄

The new Events signal seems to make the most sense to me in the long term - certainly a semconv that is attached to an Event makes sense.

Agree that Events is the most suitable signal for this kind of use case 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants