---
title: StateReportingDomain
framework: metrickit
role: symbol
role_heading: Structure
path: metrickit/statereportingdomain
---

# StateReportingDomain

A value that identifies a reporting scope for segmenting metric data.

## Declaration

```swift
struct StateReportingDomain
```

## Mentioned in

Monitoring app performance with MetricKit

## Discussion

Discussion StateReportingDomain is RawRepresentable and ExpressibleByStringLiteral, so create values using string literals. Use reverse DNS notation to avoid naming collisions: let manager = MetricManager(     enabledStateReportingDomains: ["com.example.app.session"] ) Pass a set of StateReportingDomain values to init(enabledStateReportingDomains:) to receive metrics segmented by each domain’s recorded states. Use StateReporter.reporter(for:stableMetadata:) from the StateReporting framework to obtain a StateReporter. Call reportTransition(to:stableMetadata:) on it to emit state transitions for MetricKit to aggregate.

## Relationships

### Conforms To

- [CodingKeyRepresentable](swift/codingkeyrepresentable.md)
- [Copyable](swift/copyable.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [ExpressibleByExtendedGraphemeClusterLiteral](swift/expressiblebyextendedgraphemeclusterliteral.md)
- [ExpressibleByStringLiteral](swift/expressiblebystringliteral.md)
- [ExpressibleByUnicodeScalarLiteral](swift/expressiblebyunicodescalarliteral.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### App state reporting

- [LaunchTaskID](metrickit/launchtaskid.md)
