Public API
This page documents Orleans.Lattice.Api.Telemetry 10.5.0, in the documentation for Orleans.Lattice 10.5.0 (release line 10.5), built 2026-12-05. It is also published as markdown, with every table and list, at api.md, and llms.txt lists every page.Orleans.Lattice.Api.Telemetry publishes the curated telemetry facade, the backend proxy beneath it, and the helpers a binding needs to apply the same rules. It implements the shared ILatticeTelemetry contract, whose interface, request/response records, catalogue types and exceptions live in Orleans.Lattice.Api.Abstractions under the Orleans.Lattice.Api.Telemetry namespace; both inventories are listed below. The package guide explains the catalogue, the allow-list rules, tenant scoping and the failure surface; this page is the declaration reference.
The remote transport's surface - LatticeTelemetryApiGrpcClient, its options and authorization seams - belongs to the gRPC binding and is listed in the gRPC binding's public API.
Registration
| Method | What it registers |
|---|---|
AddLatticeTelemetryBackend(this IServiceCollection services) |
The TelemetryMetricAccessPolicy compiled once from the bound options, and the default PrometheusQueryClient as IPrometheusQueryClient over a typed HttpClient - unless an IPrometheusQueryClient is already registered. Idempotent. Registers no capability check. |
AddLatticeTelemetryApi(this IServiceCollection services) |
Calls AddLatticeTelemetryBackend, then registers the built-in LatticeTelemetryQueryCatalog, TelemetryAccessAuthorizer, TelemetryTenantScopeResolver and LatticeTelemetry as ILatticeTelemetry, each with TryAdd. Idempotent. |
Neither method takes a configure delegate or registers options validation: bind LatticeTelemetryOptions with the options pattern and, to enforce its rules, register LatticeTelemetryOptionsValidator. See Configuration.
Type groups
| Group | Types |
|---|---|
| Facade | LatticeTelemetry (implements ILatticeTelemetry: GetCatalogAsync, QueryAsync) |
| Options | LatticeTelemetryOptions, LatticeTelemetryBackendAuthMode, LatticeTelemetryBackendCredential, LatticeTelemetryMetricAccessMode, LatticeTelemetryOptionsValidator |
| Catalogue | LatticeTelemetryQueries (the built-in definitions and their revision), LatticeTelemetryQueryCatalog (the deployment's offered subset) |
| Backend proxy | IPrometheusQueryClient, PrometheusQueryClient, PrometheusQueryResponse, PrometheusMetadataResponse, ITelemetryBackendTokenProvider |
| Enforcement helpers | TelemetryAccessAuthorizer, TelemetryAccessGrant, TelemetryMetricAccessPolicy, TelemetryQueryAuthorizer, TelemetryRangeGuardrails, TelemetryTenantScopeResolver, PromQlMetricExtractor, PromQlMetricReferences |
The enforcement helpers exist so a binding that evaluates caller-supplied PromQL - the MCP telemetry tool group is one - can apply the facade's capability check, allow-list and range guardrails without the curated catalogue; see The backend proxy beneath the facade.
Related
Public declaration reference
The following inventory includes directly declared public members and overloads, enum values, and record positional members. Inherited framework members and compiler-generated record members are not additional package operations. Each source link identifies the declaration that defines its signature.
Orleans.Lattice.Api.Telemetry.LatticeTelemetryQueries
Source (line 41).
public static class LatticeTelemetryQueries
public const int Versionpublic static IReadOnlyList<TelemetryQueryDefinition> Definitions
Orleans.Lattice.Api.Telemetry.LatticeTelemetryQueryCatalog
Source (line 28).
public sealed class LatticeTelemetryQueryCatalog
public LatticeTelemetryQueryCatalog(TelemetryMetricAccessPolicy policy)public LatticeTelemetryQueryCatalog(IEnumerable<TelemetryQueryDefinition> definitions, int version, TelemetryMetricAccessPolicy policy)public int Versionpublic TelemetryQueryCatalog Catalogpublic int Countpublic bool Offers(string queryId)
Orleans.Lattice.Api.Telemetry.IPrometheusQueryClient
Source (line 11).
public interface IPrometheusQueryClient
Task<PrometheusQueryResponse> InstantQueryAsync(string query, DateTimeOffset? time, CancellationToken cancellationToken)Task<PrometheusQueryResponse> RangeQueryAsync(string query, DateTimeOffset start, DateTimeOffset end, TimeSpan step, CancellationToken cancellationToken)Task<IReadOnlyList<string>> ListMetricNamesAsync(CancellationToken cancellationToken)Task<PrometheusMetadataResponse> MetricMetadataAsync(string? metric, CancellationToken cancellationToken)
Orleans.Lattice.Api.Telemetry.ITelemetryBackendTokenProvider
Source (line 19).
public interface ITelemetryBackendTokenProvider
ValueTask<string> GetAccessTokenAsync(CancellationToken cancellationToken)
Orleans.Lattice.Api.Telemetry.LatticeApiTelemetryServiceCollectionExtensions
Source (line 15).
public static class LatticeApiTelemetryServiceCollectionExtensions
public static IServiceCollection AddLatticeTelemetryBackend(this IServiceCollection services)public static IServiceCollection AddLatticeTelemetryApi(this IServiceCollection services)
Orleans.Lattice.Api.Telemetry.LatticeTelemetry
Source (line 42).
public sealed class LatticeTelemetry : ILatticeTelemetry
public LatticeTelemetry(LatticeTelemetryQueryCatalog catalog, TelemetryTenantScopeResolver scopes, TelemetryAccessAuthorizer authorizer, IPrometheusQueryClient backend, IOptions<LatticeTelemetryOptions> options, TimeProvider? timeProvider = null)public Task<TelemetryQueryCatalog> GetCatalogAsync(CancellationToken cancellationToken = default)public Task<TelemetryQueryResponse> QueryAsync(TelemetryQueryRequest request, CancellationToken cancellationToken = default)
Orleans.Lattice.Api.Telemetry.LatticeTelemetryBackendAuthMode
Source (line 10).
public enum LatticeTelemetryBackendAuthMode
NoneBearerBasicMutualTlsDynamicBearer
Orleans.Lattice.Api.Telemetry.LatticeTelemetryBackendCredential
Source (line 17).
public sealed class LatticeTelemetryBackendCredential
public string? BearerTokenpublic string? BasicUsernamepublic string? BasicPasswordpublic X509Certificate2? ClientCertificate
Orleans.Lattice.Api.Telemetry.LatticeTelemetryMetricAccessMode
Source (line 6).
public enum LatticeTelemetryMetricAccessMode
ReadAllDenyAllExceptAllowed
Orleans.Lattice.Api.Telemetry.LatticeTelemetryOptions
Source (line 20).
public class LatticeTelemetryOptions
public Uri? BackendAddresspublic LatticeTelemetryBackendAuthMode AuthModepublic LatticeTelemetryBackendCredential? Credentialpublic TimeSpan RequestTimeoutpublic TimeSpan MaxRangepublic TimeSpan MaxSteppublic LatticeTelemetryMetricAccessMode MetricAccesspublic IList<string> AllowedMetrics
Orleans.Lattice.Api.Telemetry.LatticeTelemetryOptionsValidator
Source (line 13).
public sealed class LatticeTelemetryOptionsValidator : IValidateOptions<LatticeTelemetryOptions>
public ValidateOptionsResult Validate(string? name, LatticeTelemetryOptions options)
Orleans.Lattice.Api.Telemetry.PromQlMetricExtractor
Source (line 53).
public static class PromQlMetricExtractor
public static PromQlMetricReferences ExtractReferences(string query)
Orleans.Lattice.Api.Telemetry.PromQlMetricReferences
Source (line 16).
public readonly record struct PromQlMetricReferences
public required IReadOnlyList<string> Namespublic required bool HasUnresolvableNameMatcherpublic bool HasUnconstrainedSelector
Orleans.Lattice.Api.Telemetry.PrometheusMetadataResponse
Source (line 17).
public readonly record struct PrometheusMetadataResponse(string Status, JsonElement Data)
Orleans.Lattice.Api.Telemetry.PrometheusQueryClient
Source (line 20).
public sealed class PrometheusQueryClient : IPrometheusQueryClient
public PrometheusQueryClient(HttpClient http, IOptions<LatticeTelemetryOptions> options, ITelemetryBackendTokenProvider? tokenProvider = null, ILogger<PrometheusQueryClient>? logger = null)public Task<PrometheusQueryResponse> InstantQueryAsync(string query, DateTimeOffset? time, CancellationToken cancellationToken)public Task<PrometheusQueryResponse> RangeQueryAsync(string query, DateTimeOffset start, DateTimeOffset end, TimeSpan step, CancellationToken cancellationToken)public Task<IReadOnlyList<string>> ListMetricNamesAsync(CancellationToken cancellationToken)public Task<PrometheusMetadataResponse> MetricMetadataAsync(string? metric, CancellationToken cancellationToken)
Orleans.Lattice.Api.Telemetry.PrometheusQueryResponse
Source (line 17).
public readonly record struct PrometheusQueryResponse(string Status, JsonElement Data)
Orleans.Lattice.Api.Telemetry.TelemetryAccessAuthorizer
Source (line 42).
public sealed class TelemetryAccessAuthorizer
public TelemetryAccessAuthorizer(ILatticeAccessGate? gate = null, ILatticeMembershipContext? membership = null)public ValueTask AuthorizeClusterTelemetryAsync(CancellationToken cancellationToken = default)public ValueTask AuthorizeTenantTelemetryAsync(TenantId tenant, CancellationToken cancellationToken = default)public ValueTask<bool> IsPlatformOperatorAsync(CancellationToken cancellationToken = default)
Orleans.Lattice.Api.Telemetry.TelemetryAccessGrant
Source (line 18).
public readonly record struct TelemetryAccessGrant
public static TelemetryAccessGrant ClusterWidepublic bool IsClusterWidepublic string? TenantIdpublic static TelemetryAccessGrant ForTenant(string tenantId)
Orleans.Lattice.Api.Telemetry.TelemetryMetricAccessPolicy
Source (line 39).
public sealed class TelemetryMetricAccessPolicy
public TelemetryMetricAccessPolicy(LatticeTelemetryOptions options)public bool IsReadAllpublic bool IsAdmitted(string metric)
Orleans.Lattice.Api.Telemetry.TelemetryQueryAuthorizer
Source (line 23).
public static class TelemetryQueryAuthorizer
public static bool TryAuthorizeQuery(TelemetryMetricAccessPolicy policy, string query, out string? denialMessage)public static string DeniedMessage(string metric)
Orleans.Lattice.Api.Telemetry.TelemetryRangeGuardrails
Source (line 18).
public static class TelemetryRangeGuardrails
public static bool TryValidateRange(LatticeTelemetryOptions options, DateTimeOffset start, DateTimeOffset end, TimeSpan step, out string? violationMessage)
Orleans.Lattice.Api.Telemetry.TelemetryTenantScopeResolver
Source (line 48).
public sealed class TelemetryTenantScopeResolver
public TelemetryTenantScopeResolver(ITenantContextResolver tenants, TelemetryAccessAuthorizer authorizer)public ValueTask<TelemetryAccessGrant> AuthorizeAsync(CancellationToken cancellationToken = default)public ValueTask<TelemetryTenantScope> ResolveAsync(TelemetryAccessGrant grant, TelemetryTenantVisibility requestedVisibility, string? requestedTenantId = null, CancellationToken cancellationToken = default)public ValueTask<TelemetryTenantScope> ResolveAsync(TelemetryTenantVisibility requestedVisibility, string? requestedTenantId = null, CancellationToken cancellationToken = default)
Shared contract declaration reference
The following inventory includes directly declared public members and overloads, enum values, and record positional members. Inherited framework members and compiler-generated record members are not additional package operations. Each source link identifies the declaration that defines its signature.
Orleans.Lattice.Api.Telemetry.ILatticeTelemetry
Source (line 43).
public interface ILatticeTelemetry
Task<TelemetryQueryCatalog> GetCatalogAsync(CancellationToken cancellationToken = default)Task<TelemetryQueryResponse> QueryAsync(TelemetryQueryRequest request, CancellationToken cancellationToken = default)
Orleans.Lattice.Api.Telemetry.ApiTelemetryTypeAliases
Source (line 24).
public static class ApiTelemetryTypeAliases
public const string AliasPrefixpublic const string TelemetryQueryCatalogpublic const string TelemetryQueryDescriptorpublic const string TelemetryQueryDefinitionpublic const string TelemetryQueryBoundspublic const string TelemetryQueryParameterspublic const string TelemetryQueryKindpublic const string TelemetryInstrumentReferencepublic const string TelemetryMeasurementSemanticpublic const string TelemetryQueryRequestpublic const string TelemetryQueryResponsepublic const string TelemetryTimeRangepublic const string TelemetryTimeSeriespublic const string TelemetryDataPointpublic const string TelemetryLabelpublic const string TelemetryTenantScopepublic const string TelemetryTenantVisibilitypublic const string TelemetryResultKindpublic const string TelemetryBoundsViolation
Orleans.Lattice.Api.Telemetry.TelemetryBackendException
Source (line 34).
public sealed class TelemetryBackendException : Exception
public TelemetryBackendException(string queryId, string message)public TelemetryBackendException(string queryId, string message, Exception innerException)public string QueryId
Orleans.Lattice.Api.Telemetry.TelemetryBoundsViolation
Source (line 13).
public enum TelemetryBoundsViolation
None = 0RangeNotAscending = 1StepBelowMinimum = 2StepAboveMaximum = 3RangeTooLong = 4LookbackTooOld = 5TooManyPoints = 6
Orleans.Lattice.Api.Telemetry.TelemetryDataPoint
Source (line 20).
public readonly record struct TelemetryDataPoint
public TelemetryDataPoint(DateTimeOffset timestamp, double value)public DateTimeOffset Timestamppublic double Valuepublic bool IsFinite
Orleans.Lattice.Api.Telemetry.TelemetryInstrumentReference
Source (line 19).
public readonly record struct TelemetryInstrumentReference
public TelemetryInstrumentReference(string name, string meter, string unit, TelemetryMeasurementSemantic semantic)public string Namepublic string Meterpublic string Unitpublic TelemetryMeasurementSemantic Semantic
Orleans.Lattice.Api.Telemetry.TelemetryLabel
Source (line 13).
public readonly record struct TelemetryLabel
public TelemetryLabel(string name, string value)public string Namepublic string Value
Orleans.Lattice.Api.Telemetry.TelemetryMeasurementSemantic
Source (line 20).
public enum TelemetryMeasurementSemantic
Unspecified = 0PerOperation = 1PerRecord = 2PerBatch = 3Duration = 4Level = 5Ratio = 6
Orleans.Lattice.Api.Telemetry.TelemetryQueryBounds
Source (line 27).
public readonly record struct TelemetryQueryBounds
public TimeSpan MinSteppublic TimeSpan MaxSteppublic TimeSpan DefaultSteppublic TimeSpan MaxRangepublic TimeSpan MaxLookbackpublic int MaxPointspublic static TelemetryQueryBounds Unboundedpublic bool IsUnboundedpublic TimeSpan EffectiveStep(TimeSpan requested)public TelemetryBoundsViolation Validate(TelemetryTimeRange range, DateTimeOffset now)
Orleans.Lattice.Api.Telemetry.TelemetryQueryBoundsException
Source (line 14).
public sealed class TelemetryQueryBoundsException : Exception
public TelemetryQueryBoundsException(string queryId, TelemetryBoundsViolation violation)public TelemetryQueryBoundsException(string queryId, TelemetryBoundsViolation violation, string message)public string QueryIdpublic TelemetryBoundsViolation Violation
Orleans.Lattice.Api.Telemetry.TelemetryQueryCatalog
Source (line 32).
public sealed record TelemetryQueryCatalog
public required int Versionpublic required IReadOnlyList<TelemetryQueryDescriptor> Queriespublic static TelemetryQueryCatalog Emptypublic int Countpublic bool TryGetQuery(string queryId, [NotNullWhen(true)] out TelemetryQueryDescriptor? descriptor)public bool Contains(string queryId)
Orleans.Lattice.Api.Telemetry.TelemetryQueryDefinition
Source (line 30).
public sealed record TelemetryQueryDefinition
public required TelemetryQueryDescriptor Descriptorpublic required string QueryTemplatepublic string QueryId
Orleans.Lattice.Api.Telemetry.TelemetryQueryDescriptor
Source (line 36).
public sealed record TelemetryQueryDescriptor
public required string QueryIdpublic required string Titlepublic required string Descriptionpublic required string Unitpublic TelemetryQueryKind Kindpublic TelemetryMeasurementSemantic Semanticpublic TelemetryQueryParameters Parameterspublic TelemetryQueryBounds Boundspublic required IReadOnlyList<TelemetryInstrumentReference> Instrumentspublic bool Accepts(TelemetryQueryParameters parameter)public bool ReadsInstrument(string instrumentName)
Orleans.Lattice.Api.Telemetry.TelemetryQueryKind
Source (line 11).
public enum TelemetryQueryKind
Instant = 0Range = 1
Orleans.Lattice.Api.Telemetry.TelemetryQueryNotFoundException
Source (line 16).
public sealed class TelemetryQueryNotFoundException : Exception
public TelemetryQueryNotFoundException(string queryId)public TelemetryQueryNotFoundException(string queryId, string message)public string QueryId
Orleans.Lattice.Api.Telemetry.TelemetryQueryParameters
Source (line 30).
public enum TelemetryQueryParameters
None = 0TimeRange = 1Step = 2TreeFilter = 4
Orleans.Lattice.Api.Telemetry.TelemetryQueryRequest
Source (line 38).
public sealed record TelemetryQueryRequest
public required string QueryIdpublic TelemetryTimeRange Rangepublic string? TreeIdpublic TelemetryTenantVisibility RequestedVisibilitypublic string? RequestedTenantId
Orleans.Lattice.Api.Telemetry.TelemetryQueryResponse
Source (line 32).
public sealed record TelemetryQueryResponse
public required string QueryIdpublic required TelemetryTenantScope Scopepublic TelemetryResultKind ResultKindpublic required IReadOnlyList<TelemetryTimeSeries> Seriespublic TelemetryTimeRange Rangepublic int SeriesCountpublic bool IsEmpty
Orleans.Lattice.Api.Telemetry.TelemetryResultKind
Source (line 10).
public enum TelemetryResultKind
Empty = 0Vector = 1Matrix = 2Scalar = 3
Orleans.Lattice.Api.Telemetry.TelemetryTenantScope
Source (line 38).
public readonly record struct TelemetryTenantScope
public TelemetryTenantVisibility RequestedVisibilitypublic TelemetryTenantVisibility EffectiveVisibilitypublic string? TenantIdpublic bool WasDowngradedpublic bool IsCrossTenantpublic static TelemetryTenantScope PinnedTo(string tenantId, TelemetryTenantVisibility requestedVisibility)public static TelemetryTenantScope AtRequestedTenant(string tenantId)public static TelemetryTenantScope AcrossAllTenants()
Orleans.Lattice.Api.Telemetry.TelemetryTenantVisibility
Source (line 34).
public enum TelemetryTenantVisibility
ActiveTenant = 0AllTenants = 1SingleTenant = 2
Orleans.Lattice.Api.Telemetry.TelemetryTimeRange
Source (line 27).
public readonly record struct TelemetryTimeRange
public DateTimeOffset StartUtcpublic DateTimeOffset EndUtcpublic TimeSpan Steppublic static TelemetryTimeRange At(DateTimeOffset instant)public static TelemetryTimeRange Between(DateTimeOffset startUtc, DateTimeOffset endUtc, TimeSpan step)public TimeSpan Durationpublic bool IsInstantpublic bool IsAscendingpublic long PointCountpublic TelemetryTimeRange WithStep(TimeSpan step)
Orleans.Lattice.Api.Telemetry.TelemetryTimeSeries
Source (line 12).
public sealed record TelemetryTimeSeries
public required IReadOnlyList<TelemetryLabel> Labelspublic required IReadOnlyList<TelemetryDataPoint> Pointspublic static TelemetryTimeSeries Emptypublic bool TryGetLabel(string name, out string? value)