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

[FEATURE REQ] Get Session Information for a Queue/Subscription - Azure.Messaging.ServiceBus #20569

Closed
davidallyoung opened this issue Apr 21, 2021 · 12 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. Service Bus
Milestone

Comments

@davidallyoung
Copy link

Library or service name.
What library or service is this request related to? [e.g. Azure.Storage.Blobs]
Azure.Messaging.ServiceBus

Is your feature request related to a problem? Please describe.
What feature would you like to get added? What problem is it solving?
Hi! My team is working with Sessions and having a pretty good experience leveraging them for distributing multi-tenant workloads. One of the challenges we're running into is being a bit more proactive about our scaling vs using CPU/memory. What we'd really like to be able to build around are metrics about how many sessions are on the entity. My ask here if it would be possible for the client SDK to procure theses statistics? I use ServiceBusExplorer quite a lot and it seems to have a way to grab the Sessions on an entity, but it seems like that is on one of the older revisions of the SDK.

If it isn't a good touch point for the client SDK to pull these stats, has the ASB service team considered exposing a metric for this? We could then hook up with KEDA via the Azure Monitor scaler and let it rip.

Thank you for your consideration and the great work on the new SDK!

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 21, 2021
@jsquire jsquire added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service This issue points to a problem in the service. Service Attention Workflow: This issue is responsible by Azure service team. Service Bus labels Apr 21, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Apr 21, 2021
@ghost
Copy link

ghost commented Apr 21, 2021

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @axisc.

Issue Details

Library or service name.
What library or service is this request related to? [e.g. Azure.Storage.Blobs]
Azure.Messaging.ServiceBus

Is your feature request related to a problem? Please describe.
What feature would you like to get added? What problem is it solving?
Hi! My team is working with Sessions and having a pretty good experience leveraging them for distributing multi-tenant workloads. One of the challenges we're running into is being a bit more proactive about our scaling vs using CPU/memory. What we'd really like to be able to build around are metrics about how many sessions are on the entity. My ask here if it would be possible for the client SDK to procure theses statistics? I use ServiceBusExplorer quite a lot and it seems to have a way to grab the Sessions on an entity, but it seems like that is on one of the older revisions of the SDK.

If it isn't a good touch point for the client SDK to pull these stats, has the ASB service team considered exposing a metric for this? We could then hook up with KEDA via the Azure Monitor scaler and let it rip.

Thank you for your consideration and the great work on the new SDK!

Author: davidallyoung
Assignees: -
Labels:

Service, Service Attention, Service Bus, customer-reported, needs-team-attention, needs-triage, question

Milestone: -

@jsquire
Copy link
Member

jsquire commented Apr 21, 2021

Hi @davidallyoung. Thank you for your feedback. To my knowledge, the client library is exposing all of the information that the Service Bus service makes available, in the form of the QueueRuntimeProperties accessible from the ServiceBusAdministrationClient.

Unless we've overlooked something, to return session information, we'll need to ask the Service Bus team to make that available. I've routed this to the Service Bus team for their thoughts.

@JoshLove-msft
Copy link
Member

Related - #7380

@davidallyoung
Copy link
Author

To add some more context on some other use-cases that I think are really interesting/useful for folks using sessions and run their workload in kubernetes.

kedacore/keda#1479

Also, @JoshLove-msft thank you for pulling out that issue reference, I had forgotten that I had commented on that already 😅 .

@worldspawn
Copy link

worldspawn commented Jul 1, 2021

Is there any issue open publicly with the service bus team for this?

Also how is service bus explorer able to produce a list of sessions active on a queue?

image

edit:

Apparently doable via AQMP - https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-request-response#enumerate-sessions

and whatever is going on here in the legacy library:

return this.messageCreator.CreateWcfMessage("http://schemas.microsoft.com/netservices/2011/06/servicebus/SbmpMessageReceiver/GetMessageSessions", (object) messageSessionsCommand, (string) null, this.retryPolicy, (TrackingContext) null, requestInfo);

@JoshLove-msft
Copy link
Member

It does look like there is service support, but my understanding is that there were reliability concerns when we attempted to implement this in the JS SDK.
/cc @ramya-rao-a

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jul 14, 2021

Yes, when we tried to implement enumerate-sessions in the JS SDK 2 years ago, we did see the API behave unpredictably. Not sure if anything has changed since then, but we will sync with the service team and get back

@JoshLove-msft
Copy link
Member

This feature would be useful when tuning the concurrency of a ServiceBusSessionProcessor.

@JoshLove-msft
Copy link
Member

/cc @mathewc

@ramya-rao-a ramya-rao-a added feature-request This issue requires a new behavior in the product in order be resolved. and removed Service Attention Workflow: This issue is responsible by Azure service team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Aug 25, 2021
@ghost ghost added the needs-team-triage Workflow: This issue needs the team to triage. label Aug 25, 2021
@ramya-rao-a ramya-rao-a added this to the Backlog milestone Aug 25, 2021
@ramya-rao-a ramya-rao-a added Client This issue points to a problem in the data-plane of the library. and removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service This issue points to a problem in the service. labels Aug 25, 2021
@ramya-rao-a ramya-rao-a removed the needs-team-triage Workflow: This issue needs the team to triage. label Aug 25, 2021
@JoshLove-msft
Copy link
Member

The API requires passing in a last-updated-time. If the value is not supplied the server returns an error response. After supplying this value, we only get back sessionIds that have session state set on them after this time. So if someone is not setting session state, they get back 0 sessions.

For sessions where session state is set, the session appears to always be returned even after all messages are completed. Perhaps this makes sense considering that this API appears to be designed to work based on the session state modified time.

@JoshLove-msft
Copy link
Member

Because this only works based on the session state update time, and it doesn't even filter sessions that no longer have active messages, the available service feature doesn't address the user ask which is to get access to session counts for scaling purposes.

@jsquire jsquire moved this from Planned to Needs Costing in Azure SDK for Service Bus May 16, 2023
@jsquire
Copy link
Member

jsquire commented Jul 24, 2023

At present, there is no way to implement this on the client, as service support does not exist. The Service Bus team has indicated that this is not on their roadmap currently. I'm going to close this issue out; should the service offer an API for this information, the client will support it.

If you would like to advocate for service support, consider opening a feature request in the Service Bus forum of the Azure feedback site.

@jsquire jsquire closed this as completed Jul 24, 2023
@github-project-automation github-project-automation bot moved this from Needs Costing to Done in Azure SDK for Service Bus Jul 24, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. Service Bus
Projects
Status: Done
Development

No branches or pull requests

5 participants