Skip to content

Silo metadata

Silo metadata is an immutable string-to-string map published by each silo. Use it to describe placement-relevant capabilities such as region, hardware, role, or reservation type.

Metadata supports grain placement filtering. Don’t put credentials, frequently changing health data, or large payloads in it.

Configure silo metadata with configuration

Section titled “Configure silo metadata with configuration”

UseSiloMetadata reads Orleans:Metadata:

{
"Orleans": {
"Metadata": {
"cloud.region": "westus3",
"hardware.accelerator": "gpu",
"role": "recommendations"
}
}
}
public static void ConfigureSiloMetadataFromConfiguration(string[] args)
{
var builder = Host.CreateApplicationBuilder(args);
builder.UseOrleans(siloBuilder =>
{
siloBuilder.UseSiloMetadata();
});
}

Environment variables can set deployment-specific values, for example:

Orleans__Metadata__cloud.region=westus3
Orleans__Metadata__role=recommendations

You can also supply values programmatically:

public static void ConfigureSiloMetadata(
ISiloBuilder siloBuilder,
string region,
bool hasGpu)
{
siloBuilder.UseSiloMetadata(new Dictionary<string, string>
{
["cloud.region"] = region,
["hardware.accelerator"] = hasGpu ? "gpu" : "none",
["role"] = "recommendations"
});
}

Metadata is fixed for the lifetime of a silo instance. Restart the silo to publish changed values.

Inject ISiloMetadataCache into a silo service or Orleans component:

public static void ReadSiloMetadata(
ISiloMetadataCache siloMetadataCache,
SiloAddress siloAddress,
ILogger logger)
{
var metadata = siloMetadataCache.GetSiloMetadata(siloAddress);
if (metadata.Metadata.TryGetValue("role", out var role))
{
logger.LogInformation(
"Silo {Silo} has role {Role}",
siloAddress,
role);
}
}

The cache follows cluster membership and fetches metadata from active silos. GetSiloMetadata returns the locally cached value, so it doesn’t add a remote call to the request path.

  • Use stable, namespaced keys such as cloud.region or hardware.accelerator.
  • Treat key names and values as an application contract.
  • Define behavior for missing or unknown values during rolling deployments.
  • Keep values low-cardinality when they feed placement or telemetry.
  • Ensure enough silos match every required placement filter.

Metadata complements heterogeneous silo configuration: use Classes when a silo cannot host a grain class, and metadata placement filters when it can host the class but should be selected based on capability.