|
468 | 468 | The UID of the resource quota. |
469 | 469 | """ |
470 | 470 |
|
| 471 | +K8S_SERVICE_ANNOTATION_TEMPLATE: Final = "k8s.service.annotation" |
| 472 | +""" |
| 473 | +The annotation placed on the Service, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty. |
| 474 | +Note: Examples: |
| 475 | +
|
| 476 | +- An annotation `prometheus.io/scrape` with value `true` SHOULD be recorded as |
| 477 | + the `k8s.service.annotation.prometheus.io/scrape` attribute with value `"true"`. |
| 478 | +- An annotation `data` with empty string value SHOULD be recorded as |
| 479 | + the `k8s.service.annotation.data` attribute with value `""`. |
| 480 | +""" |
| 481 | + |
| 482 | +K8S_SERVICE_ENDPOINT_ADDRESS_TYPE: Final = "k8s.service.endpoint.address_type" |
| 483 | +""" |
| 484 | +The address type of the service endpoint. |
| 485 | +Note: The network address family or type of the endpoint. |
| 486 | +This attribute aligns with the `addressType` field of the |
| 487 | +[K8s EndpointSlice](https://kubernetes.io/docs/reference/kubernetes-api/service-resources/endpoint-slice-v1/). |
| 488 | +It is used to differentiate metrics when a Service is backed by multiple address types |
| 489 | +(e.g., in dual-stack clusters). |
| 490 | +""" |
| 491 | + |
| 492 | +K8S_SERVICE_ENDPOINT_CONDITION: Final = "k8s.service.endpoint.condition" |
| 493 | +""" |
| 494 | +The condition of the service endpoint. |
| 495 | +Note: The current operational condition of the service endpoint. |
| 496 | +An endpoint can have multiple conditions set at once (e.g., both `serving` and `terminating` during rollout). |
| 497 | +This attribute aligns with the condition fields in the [K8s EndpointSlice](https://kubernetes.io/docs/reference/kubernetes-api/service-resources/endpoint-slice-v1/). |
| 498 | +""" |
| 499 | + |
| 500 | +K8S_SERVICE_ENDPOINT_ZONE: Final = "k8s.service.endpoint.zone" |
| 501 | +""" |
| 502 | +The zone of the service endpoint. |
| 503 | +Note: The zone where the endpoint is located, typically corresponding to a failure domain. |
| 504 | +This attribute aligns with the `zone` field of endpoints in the |
| 505 | +[K8s EndpointSlice](https://kubernetes.io/docs/reference/kubernetes-api/service-resources/endpoint-slice-v1/). |
| 506 | +It enables zone-aware monitoring of service endpoint distribution and supports |
| 507 | +features like [Topology Aware Routing](https://kubernetes.io/docs/concepts/services-networking/topology-aware-routing/). |
| 508 | +
|
| 509 | +If the zone is not populated (e.g., nodes without the `topology.kubernetes.io/zone` label), |
| 510 | +the attribute value will be an empty string. |
| 511 | +""" |
| 512 | + |
| 513 | +K8S_SERVICE_LABEL_TEMPLATE: Final = "k8s.service.label" |
| 514 | +""" |
| 515 | +The label placed on the Service, the `<key>` being the label name, the value being the label value, even if the value is empty. |
| 516 | +Note: Examples: |
| 517 | +
|
| 518 | +- A label `app` with value `my-service` SHOULD be recorded as |
| 519 | + the `k8s.service.label.app` attribute with value `"my-service"`. |
| 520 | +- A label `data` with empty string value SHOULD be recorded as |
| 521 | + the `k8s.service.label.data` attribute with value `""`. |
| 522 | +""" |
| 523 | + |
| 524 | +K8S_SERVICE_NAME: Final = "k8s.service.name" |
| 525 | +""" |
| 526 | +The name of the Service. |
| 527 | +""" |
| 528 | + |
| 529 | +K8S_SERVICE_PUBLISH_NOT_READY_ADDRESSES: Final = ( |
| 530 | + "k8s.service.publish_not_ready_addresses" |
| 531 | +) |
| 532 | +""" |
| 533 | +Whether the Service publishes not-ready endpoints. |
| 534 | +Note: Whether the Service is configured to publish endpoints before the pods are ready. |
| 535 | +This attribute is typically used to indicate that a Service (such as a headless |
| 536 | +Service for a StatefulSet) allows peer discovery before pods pass their readiness probes. |
| 537 | +It aligns with the `publishNotReadyAddresses` field of the |
| 538 | +[K8s ServiceSpec](https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/#ServiceSpec). |
| 539 | +""" |
| 540 | + |
| 541 | +K8S_SERVICE_SELECTOR_TEMPLATE: Final = "k8s.service.selector" |
| 542 | +""" |
| 543 | +The selector key-value pair placed on the Service, the `<key>` being the selector key, the value being the selector value. |
| 544 | +Note: These selectors are used to correlate with pod labels. Each selector key-value pair becomes a separate attribute. |
| 545 | +
|
| 546 | +Examples: |
| 547 | +
|
| 548 | +- A selector `app=my-app` SHOULD be recorded as |
| 549 | + the `k8s.service.selector.app` attribute with value `"my-app"`. |
| 550 | +- A selector `version=v1` SHOULD be recorded as |
| 551 | + the `k8s.service.selector.version` attribute with value `"v1"`. |
| 552 | +""" |
| 553 | + |
| 554 | +K8S_SERVICE_TRAFFIC_DISTRIBUTION: Final = "k8s.service.traffic_distribution" |
| 555 | +""" |
| 556 | +The traffic distribution policy for the Service. |
| 557 | +Note: Specifies how traffic is distributed to endpoints for this Service. |
| 558 | +This attribute aligns with the `trafficDistribution` field of the |
| 559 | +[K8s ServiceSpec](https://kubernetes.io/docs/reference/networking/virtual-ips/#traffic-distribution). |
| 560 | +Known values include `PreferSameZone` (prefer endpoints in the same zone as the client) and |
| 561 | +`PreferSameNode` (prefer endpoints on the same node, fallback to same zone, then cluster-wide). |
| 562 | +If this field is not set on the Service, the attribute SHOULD NOT be emitted. |
| 563 | +When not set, Kubernetes distributes traffic evenly across all endpoints cluster-wide. |
| 564 | +""" |
| 565 | + |
| 566 | +K8S_SERVICE_TYPE: Final = "k8s.service.type" |
| 567 | +""" |
| 568 | +The type of the Kubernetes Service. |
| 569 | +Note: This attribute aligns with the `type` field of the |
| 570 | +[K8s ServiceSpec](https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/#ServiceSpec). |
| 571 | +""" |
| 572 | + |
| 573 | +K8S_SERVICE_UID: Final = "k8s.service.uid" |
| 574 | +""" |
| 575 | +The UID of the Service. |
| 576 | +""" |
| 577 | + |
471 | 578 | K8S_STATEFULSET_ANNOTATION_TEMPLATE: Final = "k8s.statefulset.annotation" |
472 | 579 | """ |
473 | 580 | The annotation placed on the StatefulSet, the `<key>` being the annotation name, the value being the annotation value, even if the value is empty. |
@@ -601,6 +708,35 @@ class K8sPodStatusReasonValues(Enum): |
601 | 708 | """The pod was rejected admission to the node because of an error during admission that could not be categorized.""" |
602 | 709 |
|
603 | 710 |
|
| 711 | +class K8sServiceEndpointAddressTypeValues(Enum): |
| 712 | + IPV4 = "IPv4" |
| 713 | + """IPv4 address type.""" |
| 714 | + IPV6 = "IPv6" |
| 715 | + """IPv6 address type.""" |
| 716 | + FQDN = "FQDN" |
| 717 | + """FQDN address type.""" |
| 718 | + |
| 719 | + |
| 720 | +class K8sServiceEndpointConditionValues(Enum): |
| 721 | + READY = "ready" |
| 722 | + """The endpoint is ready to receive new connections.""" |
| 723 | + SERVING = "serving" |
| 724 | + """The endpoint is currently handling traffic.""" |
| 725 | + TERMINATING = "terminating" |
| 726 | + """The endpoint is in the process of shutting down.""" |
| 727 | + |
| 728 | + |
| 729 | +class K8sServiceTypeValues(Enum): |
| 730 | + CLUSTER_IP = "ClusterIP" |
| 731 | + """ClusterIP service type.""" |
| 732 | + NODE_PORT = "NodePort" |
| 733 | + """NodePort service type.""" |
| 734 | + LOAD_BALANCER = "LoadBalancer" |
| 735 | + """LoadBalancer service type.""" |
| 736 | + EXTERNAL_NAME = "ExternalName" |
| 737 | + """ExternalName service type.""" |
| 738 | + |
| 739 | + |
604 | 740 | class K8sVolumeTypeValues(Enum): |
605 | 741 | PERSISTENT_VOLUME_CLAIM = "persistentVolumeClaim" |
606 | 742 | """A [persistentVolumeClaim](https://v1-30.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim) volume.""" |
|
0 commit comments