Python bindings: Provide a way to send "built-in" pings for command line tools
Categories
(Data Platform and Tools :: Glean: SDK, defect, P3)
Tracking
(Not tracked)
People
(Reporter: mdroettboom, Unassigned)
References
Details
(Whiteboard: [telemetry:glean-rs:m13][glean-py])
Attachments
(1 file)
There is currently no way to send "built-in" pings (baseline, metrics, events) from the Python bindings. This will be required to automated end-to-end tests.
There are a few alternatives:
-
Make
Glean.send_pings_by_name
public. This will allow any ping to be sent on command. -
Add APIs that "simulate" app-level events, e.g.
Glean.handle_background_event
, which would trigger the sending of the baseline and events pings as if the user went to background. This means the tests are written as if automated an app, and which pings get sent remains an implementation detail. -
Add a
send_all_pings
method, which would send all registered pings immediately.
Reporter | ||
Updated•6 years ago
|
Comment 1•6 years ago
|
||
(In reply to Michael Droettboom [:mdroettboom] from comment #0)
There is currently no way to send "built-in" pings (baseline, metrics, events) from the Python bindings. This will be required to automated end-to-end tests.
I don't think this should be required. End to end testing could just use and submit custom pings for the use case highlighted in the design document. All in all, this is for testing that Glean SDK-generated data can be queried/answer questions at the end of the pipeline: doesn't really need a Glean-defined ping.
If application behaviour is important or required, then I think we should probably find a way to puppet existing sample applications or real product.
Comment 2•6 years ago
|
||
-
Would require knowledge of the Glean built-in pings from the consumers of the Python SDK. This is currently not required for existing products using Glean, correct?
-
This would be OK for the proof-of-concept for the end-to-end tests, but probably not idiomatic for other Python applications, which don't have a concept of going-to-background as for example command-line tools
-
This API would be ideal for the proof-of-concept for the end-to-end tests since it doesn't require knowledge of the Glean built-in pings, but makes sure we execute a critical code path in glean-core without faking events
Reporter | ||
Comment 3•6 years ago
|
||
I think where we ended up is to not do this for MVP, but to reinvestigate it when these bindings will be used for end-user applications.
Reporter | ||
Comment 4•5 years ago
•
|
||
In light of inclusion in mozregression, mozphab and soon mach, we should probably have a plan for this.
I think it's important to note that unlike Kotlin/Android and Swift/iOS, we anticipate Python being used in a few different very different contexts -- command line tools, web servers, integration tests. The naming proposal introduces the concept of "application lifecycle type" for these different things. I'm proposing limiting the scope of this bug to just the "command line tool" application type, since that is the most pressing need at the moment.
Reporter | ||
Comment 5•5 years ago
|
||
Comment 6•5 years ago
|
||
Comment 7•5 years ago
|
||
Comment 8•5 years ago
|
||
Updated•5 years ago
|
Comment 9•5 years ago
|
||
(In reply to Travis Long [:travis_] from comment #8)
Comment on attachment 9133182 [details]
Proposal for non-mobile application lifecycle typesSince we really only have two events that Glean cares about right now, I
think I lean more towards the flexible approach proposed by Jan-Erik: if we
expose the right hooks, then applications are free to define their own
lifecycle start and stop events and we aren't stuck with the burden of
wiring in every lifecycle we can think of now, and every new one that pops
up.
It does provide yet another way for embedding applications to fail to do this "properly", though. Are we okay if, e.g., applications opt out of hooking these up at all? Call them in the 'wrong' order?
Comment 10•5 years ago
|
||
Updated•5 years ago
|
Description
•