docs.particular.net icon indicating copy to clipboard operation
docs.particular.net copied to clipboard

Add details about endpoint display names in ServicePulse under Azure

Open boblangley opened this issue 8 years ago • 9 comments

Completes https://github.com/Particular/NServiceBus.Host.AzureCloudService/issues/49

We need docu about hosting in Azure and how it relates to ServicePulse, specifically setting the display name so ServicePulse shows the instance using Azure relevant information. Ideally, but not required, we would created this document in a way that is inclusive of WebJob hosting as well.

Host v7 shipped changing the behavior to display CurrentRoleName_CurrentRoleInstanceId

Host v6 currently displays the old endpointname@machinename value. We didn't backport the change we made when we released host v7. We should provide a suggested work around as described in #54 to replicate the Host v7 style:

var roleName = SafeRoleEnvironment.CurrentRoleName;
var instanceId = SafeRoleEnvironment.CurrentRoleInstanceId;
busConfiguration.GetSettings().Set("NServiceBus.HostInformation.DisplayName", $"{roleName}_{instanceId}");

To provide a similar experience for WebJobs we would explain how to get a similar experience, and one of our customers has already done the legwork. We should adapt this approach to show an override combing the Azure web app name and the instance id similar to the approach we took for cloud services, using the environment variables provided as demonstrated on Amit's Blog post:

For Core V5 endpoints:

var instanceId = Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID");
var siteName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME");
busConfiguration.GetSettings().Set("NServiceBus.HostInformation.DisplayName", $"{siteName}_{instanceId}");

For Core V6 endpoints:

var instanceId = Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID");
var siteName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME");
endpointConfiguration
   .UniquelyIdentifyRunningInstance()
   .UsingNames(instanceId, siteName)
   .UsingCustomDisplayName($"{siteName}_{instanceId}");

Ping @Particular/azure-maintainers

boblangley avatar Sep 13 '17 18:09 boblangley

Is this Azure specific or it could be suitable for any other environment? Sounds like SP related information that should be captures with SP as well as he "Overriding the Host Identifier" page.

SeanFeldman avatar Sep 14 '17 04:09 SeanFeldman

@SeanFeldman It seems like as soon as we start assuming environment variables being present the documentation becomes Azure specific.

danielmarbach avatar Sep 14 '17 06:09 danielmarbach

Putting myself in the customer shoes*, I'd be looking for this information under the product first. It could have general guidance as well as specific sections for specific environments such as Azure.

* scaling out my endpoints -> they all use the same name -> searching SP doco about endpoint instances -> boom, it has that info.

SeanFeldman avatar Sep 14 '17 21:09 SeanFeldman

Why not do both?

boblangley avatar Sep 15 '17 02:09 boblangley

Fine with that. Where would it go under "azure"?

SeanFeldman avatar Sep 15 '17 03:09 SeanFeldman

@boblangley @SeanFeldman Is figuring out the right place the only thing left here? Can I help?

weralabaj avatar Oct 04 '17 12:10 weralabaj

@weralabaj you could arbitrate and decide where that information could go. What Bob suggested could be a way of handling.

SeanFeldman avatar Oct 05 '17 04:10 SeanFeldman

I am working on a PR for this now.

boblangley avatar Oct 10 '17 13:10 boblangley

@boblangley ping

weralabaj avatar May 08 '18 13:05 weralabaj

ServicePulse can show logical endpoints in heartbeats now. The outstanding bit is for the monitoring portion which is tracked by https://github.com/Particular/ServicePulse/issues/468. Closing.

WilliamBZA avatar May 30 '23 17:05 WilliamBZA