launchdarkly / api-client-python

LaunchDarkly API Client for Python
Other
5 stars 8 forks source link

How do I get the client side MAU? #6

Closed Michael-Dougherty closed 2 years ago

Michael-Dougherty commented 2 years ago

Hello, I am trying to get the Client Side MAU for the projects and I am able to get the server side using get mau usage rest end point. (https://apidocs.launchdarkly.com/reference#usage-mau) How do I get the client side MAU?

annabkr commented 2 years ago

Hi @Michael-Dougherty, you can get the Client-Side MAU by making a request to the Get MAU Usage endpoint with the query parameter sdktype set to client:

GET https://app.launchdarkly.com/api/v2/usage/mau?sdktype=client

Here is the link to the method for that endpoint.

Thank you for bringing this to our attention. It looks like the API documentation had not been updated to reflect that optional parameter. I've filed a ticket to get the documentation up to date.

Hope that helps.

Michael-Dougherty commented 2 years ago

It does thank you. Mike

From: Anna Baker @.> Sent: Wednesday, August 11, 2021 2:17 PM To: launchdarkly/api-client-python @.> Cc: Michael Dougherty @.>; Mention @.> Subject: Re: [launchdarkly/api-client-python] How do I get the client side MAU? (#6)

WARNING: This email originated from outside of the organization. DO NOT click links, open attachments, or respond unless you recognize the sender and know the content is safe.


Hi @Michael-Doughertyhttps://urldefense.com/v3/__https:/github.com/Michael-Dougherty__;!!F1Q1IbZmrAg!ThcWFOru4zDVde5fEXrb8V7UtGWk20IMO98M4v2FGUVUtNa-9IaccOXY6IdJ1DGCT97yvUA$, you can get the Client-Side MAU by making a request to the Get MAU Usage endpointhttps://urldefense.com/v3/__https:/apidocs.launchdarkly.com/reference*usage-mau__;Iw!!F1Q1IbZmrAg!ThcWFOru4zDVde5fEXrb8V7UtGWk20IMO98M4v2FGUVUtNa-9IaccOXY6IdJ1DGCCktGxM8$ with the query parameter sdktype set to client:

GET https://app.launchdarkly.com/api/v2/usage/mau?sdktype=clienthttps://urldefense.com/v3/__https:/app.launchdarkly.com/api/v2/usage/mau?sdktype=client__;!!F1Q1IbZmrAg!ThcWFOru4zDVde5fEXrb8V7UtGWk20IMO98M4v2FGUVUtNa-9IaccOXY6IdJ1DGCvy1pKMo$

Here is the link to the methodhttps://urldefense.com/v3/__https:/github.com/launchdarkly/api-client-python/blob/d51323be2d3125b68eaa67f5b48c1ce9ecb6c192/launchdarkly_api/api/customer_metrics_api.py*L327__;Iw!!F1Q1IbZmrAg!ThcWFOru4zDVde5fEXrb8V7UtGWk20IMO98M4v2FGUVUtNa-9IaccOXY6IdJ1DGCWPANwaU$ for that endpoint.

Thank you for bringing this to our attention. It looks like the API documentation had not been updated to reflect that optional parameter. I've filed a ticket to get the documentation up to date.

Hope that helps.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/launchdarkly/api-client-python/issues/6*issuecomment-897045854__;Iw!!F1Q1IbZmrAg!ThcWFOru4zDVde5fEXrb8V7UtGWk20IMO98M4v2FGUVUtNa-9IaccOXY6IdJ1DGCRxYplAY$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ALXMTUW3NPG54HU2YMFIGHTT4K5BVANCNFSM5B6QZULQ__;!!F1Q1IbZmrAg!ThcWFOru4zDVde5fEXrb8V7UtGWk20IMO98M4v2FGUVUtNa-9IaccOXY6IdJ1DGCuIhCrZY$. Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.com/v3/__https:/apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!F1Q1IbZmrAg!ThcWFOru4zDVde5fEXrb8V7UtGWk20IMO98M4v2FGUVUtNa-9IaccOXY6IdJ1DGC67UOZMY$ or Androidhttps://urldefense.com/v3/__https:/play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email__;!!F1Q1IbZmrAg!ThcWFOru4zDVde5fEXrb8V7UtGWk20IMO98M4v2FGUVUtNa-9IaccOXY6IdJ1DGCcwj1MfY$.


This email, including any attachments, may contain confidential and/or proprietary information intended only for the use of the recipient. If you are not the intended recipient, any distribution, copying, or use of this email or its attachments is prohibited. If you received this email in error, please reply to the sender immediately and delete this message and any copies.

Bentley Systems has taken all reasonable steps to ensure that this communication is free from viruses, data corruption, and unauthorized alteration. Bentley Systems does not accept liability for any damages that may be incurred as a result of this or any communication by email

[https://cdn2.webdamdb.com/310th_sm_UnR3pO7k0ir0.jpg?1616176329]

Michael-Dougherty commented 2 years ago

One other question if I may, how do I get the client MAUs for the projects? Like the one on breakdown view? https://app.launchdarkly.com/settings/usage/details/client

annabkr commented 2 years ago

One other question if I may, how do I get the client MAUs for the projects? Like the one on breakdown view? https://app.launchdarkly.com/settings/usage/details/client

That view is powered by the same API, with another query parameter that it appears is also not documented. Thank you for raising this!

If you append a groupby query parameter set to project, that will hopefully give you what you're looking for:

GET https://app.launchdarkly.com/api/v2/usage/mau?sdktype=client&groupby=project

Let me know if that helps.

Michael-Dougherty commented 2 years ago

You are the best! thank you again.

From: Anna Baker @.> Sent: Wednesday, August 11, 2021 5:09 PM To: launchdarkly/api-client-python @.> Cc: Michael Dougherty @.>; Mention @.> Subject: Re: [launchdarkly/api-client-python] How do I get the client side MAU? (#6)

WARNING: This email originated from outside of the organization. DO NOT click links, open attachments, or respond unless you recognize the sender and know the content is safe.


One other question if I may, how do I get the client MAUs for the projects? Like the one on breakdown view? https://app.launchdarkly.com/settings/usage/details/clienthttps://urldefense.com/v3/__https:/app.launchdarkly.com/settings/usage/details/client__;!!F1Q1IbZmrAg!S6h5nlEy9bjGDjjEjKCWUBusU-4P_VisfNxQcjQ5BCjLNsKKwLjZl-cm4tJ68uDfKEdj_GM$

That view is powered by the same APIhttps://urldefense.com/v3/__https:/apidocs.launchdarkly.com/reference*usage-mau__;Iw!!F1Q1IbZmrAg!S6h5nlEy9bjGDjjEjKCWUBusU-4P_VisfNxQcjQ5BCjLNsKKwLjZl-cm4tJ68uDf38Scj74$, with another query parameter that it appears is also not documented. Thank you for raising this!

If you append a groupby query parameter set to project, that will hopefully give you what you're looking for:

GET https://app.launchdarkly.com/api/v2/usage/mau?sdktype=client&groupby=projecthttps://urldefense.com/v3/__https:/app.launchdarkly.com/api/v2/usage/mau?sdktype=client&groupby=project__;!!F1Q1IbZmrAg!S6h5nlEy9bjGDjjEjKCWUBusU-4P_VisfNxQcjQ5BCjLNsKKwLjZl-cm4tJ68uDfy9AjIio$

Let me know if that helps.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/launchdarkly/api-client-python/issues/6*issuecomment-897153849__;Iw!!F1Q1IbZmrAg!S6h5nlEy9bjGDjjEjKCWUBusU-4P_VisfNxQcjQ5BCjLNsKKwLjZl-cm4tJ68uDf1FpCPD8$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ALXMTUUKUDBQX7X7CNCNYUTT4LRF5ANCNFSM5B6QZULQ__;!!F1Q1IbZmrAg!S6h5nlEy9bjGDjjEjKCWUBusU-4P_VisfNxQcjQ5BCjLNsKKwLjZl-cm4tJ68uDffg_Dieo$. Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.com/v3/__https:/apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!F1Q1IbZmrAg!S6h5nlEy9bjGDjjEjKCWUBusU-4P_VisfNxQcjQ5BCjLNsKKwLjZl-cm4tJ68uDfkhYqcf4$ or Androidhttps://urldefense.com/v3/__https:/play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email__;!!F1Q1IbZmrAg!S6h5nlEy9bjGDjjEjKCWUBusU-4P_VisfNxQcjQ5BCjLNsKKwLjZl-cm4tJ68uDfcIjK7Mw$.


This email, including any attachments, may contain confidential and/or proprietary information intended only for the use of the recipient. If you are not the intended recipient, any distribution, copying, or use of this email or its attachments is prohibited. If you received this email in error, please reply to the sender immediately and delete this message and any copies.

Bentley Systems has taken all reasonable steps to ensure that this communication is free from viruses, data corruption, and unauthorized alteration. Bentley Systems does not accept liability for any damages that may be incurred as a result of this or any communication by email

[https://cdn2.webdamdb.com/310th_sm_UnR3pO7k0ir0.jpg?1616176329]