Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] [DO NOT MERGE] Entities support prototype #35538

Closed
wants to merge 1 commit into from

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented Oct 2, 2024

  • Most of the changes are files generated by the updated mdatagen tool in [DRAFT] [DO NOT MERGE] Entities support prototype opentelemetry-collector#11282. The affected components supporting entity references are host receiver and resource detection processor. Only their metadata.yaml was updated, with no manual changes to the code. The entity references are added in the generated code.
  • k8scluster receiver was updated to deal with pdata entities instead of the experimental log-based entities package, but it still produces logs.
  • Host metrics receiver and k8scluster now produce entities instead of logs.
  • Resource detection processor enriches entity data model as well

Result

Using the following collector configuration

receivers:
  hostmetrics:
    collection_interval: 10s
    scrapers:
      cpu:
exporters:
  debug:
    verbosity: detailed
processors:
  resourcedetection:
    detectors:
      - system
    system:
      resource_attributes:
        host.id:
          enabled: true
        os.description:
          enabled: true
        host.arch:
          enabled: true
        host.ip:
          enabled: true
        host.mac:
          enabled: true
        host.cpu.vendor.id:
          enabled: true
        host.cpu.family:
          enabled: true
        host.cpu.model.id:
          enabled: true
        host.cpu.model.name:
          enabled: true
        host.cpu.stepping:
          enabled: true
        host.cpu.cache.l2.size:
          enabled: true
service:
  pipelines:
    metrics:
      receivers:
        - hostmetrics
      processors:
        - resourcedetection
      exporters:
        - debug

The output of the debug processor now includes the entity references that are added by the resource detection processor (note that all optional resource attributes had to be enabled in the collector configuration):

2024-10-02T22:39:05.392-0700	info	MetricsExporter	{"kind": "exporter", "data_type": "metrics", "name": "debug", "resource metrics": 1, "metrics": 1, "data points": 40}
2024-10-02T22:39:05.397-0700	info	ResourceMetrics #0
Resource SchemaURL: https://opentelemetry.io/schemas/1.9.0
Resource attributes:
     -> host.name: Str(L0DW3V3F09)
     -> os.type: Str(darwin)
     -> host.id: Str(2EBC3D9B-BE17-542F-A036-79911CE23546)
     -> host.arch: Str(arm64)
     -> host.ip: Slice(["fe80::bcd0:74ff:fe68:60c1","fe80::b0:2b6d:f5df:f14d","2601:646:8300:4190::759","10.0.0.243","2601:646:8300:4190:104f:9fa2:4200:5eeb","2601:646:8300:4190:8da7:5aaf:2870:1a63","fe80::b40b:24ff:fefa:9e06","fe80::b40b:24ff:fefa:9e06","fe80::f01b:5675:d928:dc64","fe80::8635:9275:ab7a:d1fc","fe80::d241:fd05:a2b:b2b0","fe80::ce81:b1c:bd2c:69e","fe80::e6aa:1f5d:6347:2421","fe80::c44a:6ada:683:740e","fe80::de58:23c2:280f:9f23","fe80::2dd5:ef28:90f2:e9aa"])
     -> host.mac: Slice(["22-91-2B-27-19-37","22-91-2B-27-19-38","22-91-2B-27-19-39","22-91-2B-27-19-17","22-91-2B-27-19-18","22-91-2B-27-19-19","36-04-2B-F6-B4-80","36-04-2B-F6-B4-84","36-04-2B-F6-B4-88","36-04-2B-F6-B4-80","BE-D0-74-68-60-C1","BC-D0-74-68-60-C1","B6-0B-24-FA-9E-06","B6-0B-24-FA-9E-06","","","","","","","","",""])
     -> os.description: Str(macOS 14.6.1 (23G93) (Darwin L0DW3V3F09 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000 arm64))
     -> host.cpu.vendor.id: Str()
     -> host.cpu.family: Str(0)
     -> host.cpu.model.id: Str(0)
     -> host.cpu.model.name: Str(Apple M1 Max)
     -> host.cpu.stepping: Str(0)
     -> host.cpu.cache.l2.size: Int(0)
Entities:
Entity Ref #0
     -> Entity Type: host
     -> SchemaURL:
     -> Identifying Attributes: host.id
     -> Descriptive Attributes: host.name, os.type, host.arch, host.ip, host.mac, host.cpu.vendor.id, host.cpu.family, host.cpu.model.id, host.cpu.model.name, host.cpu.stepping, host.cpu.cache.l2.size

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@ChrsMark
Copy link
Member

Update host metrics receiver and k8scluster receiver to produce entities instead of logs.

Is k8scluster receiver the right component for this? I wonder if that better fits in the k8sobjectsreceiver.

ref: #24419 (comment)

@github-actions github-actions bot removed the Stale label Oct 23, 2024
Copy link
Contributor

github-actions bot commented Nov 7, 2024

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@dmitryax
Copy link
Member Author

dmitryax commented Nov 7, 2024

Is k8scluster receiver the right component for this? I wonder if that better fits in the k8sobjectsreceiver.

Potentially yes. Right now, we have experimental entities emitted by the k8scluster receiver. I think we can keep it there for now and reconsider later.

k8sobjects intentionally produces logs right now, specifically to support events. I think we need to resolve overlap between k8sobjects and k8sevents receiver first.

@github-actions github-actions bot removed the Stale label Nov 8, 2024
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Nov 23, 2024
Copy link
Contributor

github-actions bot commented Dec 8, 2024

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Dec 8, 2024
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