Skip to content

[receiver/k8s_cluster] Define entities and relationships in metadata.yaml#46172

Merged
dmitryax merged 1 commit intoopen-telemetry:mainfrom
dmitryax:k8s-cluster-receiver-resource-entities
Feb 18, 2026
Merged

[receiver/k8s_cluster] Define entities and relationships in metadata.yaml#46172
dmitryax merged 1 commit intoopen-telemetry:mainfrom
dmitryax:k8s-cluster-receiver-resource-entities

Conversation

@dmitryax
Copy link
Member

@dmitryax dmitryax commented Feb 18, 2026

Define entities and relationships for Kubernetes resources in metadata.yaml.

Updates #41080

This PR adds entity type definitions with their identity and descriptive attributes, as well as relationships between entities (e.g., pod managed_by replicaset, deployment part_of namespace). These definitions will be used by the metadata generator to create the necessary code for entity support in a future update.

@dmitryax dmitryax force-pushed the k8s-cluster-receiver-resource-entities branch from 200c19e to 4deb683 Compare February 18, 2026 01:41
@dmitryax dmitryax marked this pull request as ready for review February 18, 2026 01:42
@dmitryax dmitryax requested review from a team, ChrsMark and TylerHelmuth as code owners February 18, 2026 01:42
@github-actions github-actions bot requested a review from povilasv February 18, 2026 01:42
@dmitryax dmitryax force-pushed the k8s-cluster-receiver-resource-entities branch from ae8ad71 to dc58f48 Compare February 18, 2026 02:42
- ref: k8s.deployment.uid
description:
- ref: k8s.deployment.name
relationships:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this part of the data-model already?

That would also be nice to be surfaced in the generated docs too I guess.

Copy link
Member Author

@dmitryax dmitryax Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this part of the data-model already?

Not yet. It is about to be defined in open-telemetry/opentelemetry-specification#4836.

For now, mdatagen only supports relationship definitions (see open-telemetry/opentelemetry-collector#14582). The type of relationships is currently ignored.

At this stage, I only need the relationships as plain connections in order to generate the new metrics builder Go API based on the set of entities associated with metrics in metadata.yaml. Once that API generation is ready, I'll apply it to k8s_cluster receiver to see the diff in generated Go code. But as the preliminary step, I'ld like the receiver to have entities defined first

@ChrsMark
Copy link
Member

Needs rebase.

@dmitryax dmitryax force-pushed the k8s-cluster-receiver-resource-entities branch from dc58f48 to 53d2929 Compare February 18, 2026 20:24
@dmitryax dmitryax changed the title [receiver/k8s_cluster] Emit entity references in the metrics resource [receiver/k8s_cluster] Define entities and relationships in metadata.yaml Feb 18, 2026
@dmitryax
Copy link
Member Author

I removed changes on the emitted data for now. Otherwise, it would result in incomplete entities that don't support disabling attributes. For now, I kept entities and relationships definition only

Define entities and relationships for Kubernetes resources in metadata.yaml.

Resolves open-telemetry#41080

The new data is added to the experimental resource proto field proto (https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/resource/v1/resource.proto#L44) and be be simply ignored if not needed.
@dmitryax dmitryax force-pushed the k8s-cluster-receiver-resource-entities branch from 53d2929 to 5ac7633 Compare February 18, 2026 21:16
@dmitryax dmitryax merged commit 4a967d1 into open-telemetry:main Feb 18, 2026
198 checks passed
geekdave pushed a commit to oso-team/opentelemetry-collector-contrib that referenced this pull request Feb 20, 2026
…yaml (open-telemetry#46172)

Define entities and relationships for Kubernetes resources in
metadata.yaml.

Updates
open-telemetry#41080

This PR adds entity type definitions with their identity and descriptive
attributes, as well as relationships between entities (e.g., pod
managed_by replicaset, deployment part_of namespace). These definitions
will be used by the metadata generator to create the necessary code for
entity support in a future update.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants