| 1 | // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | use serde::{Deserialize, Serialize}; |
| 5 | |
| 6 | /// Identifies the source of a metric record by service, resource, and component. |
| 7 | #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)] |
| 8 | pub struct Attribution { |
| 9 | /// The service or application name (e.g. "my-tls-service") |
| 10 | pub service: String, |
| 11 | /// The resource producing metrics (e.g. an ARN or listener name) |
| 12 | pub resource: String, |
| 13 | /// Distinguishes telemetry from multiple components within the same |
| 14 | /// application. For example, a load balancer application might want to |
| 15 | /// record both "frontend" and "backend" telemetry. Leave empty to emit |
| 16 | /// just "TlsTelemetry" without a component suffix. |
| 17 | #[serde(default)] |
| 18 | pub component: String, |
| 19 | } |