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

New component: Add systemd receiver #33532

Open
3 tasks
Hemansh31 opened this issue Jun 13, 2024 · 10 comments
Open
3 tasks

New component: Add systemd receiver #33532

Hemansh31 opened this issue Jun 13, 2024 · 10 comments
Labels
Accepted Component New component has been sponsored

Comments

@Hemansh31
Copy link

Hemansh31 commented Jun 13, 2024

The purpose and use-cases of the new component

The systemd receiver collects the value of different properties of a systemd unit and publishes that data as metrics data.

Example configuration for the component

receivers:
systemd:
services:
- sshd.service
- example.service
properties:
- ActiveState
- LoadedState
- MainPID

Telemetry data types supported

These would be primarily metrics

Is this a vendor-specific component?

  • This is a vendor-specific component
  • If this is a vendor-specific component, I am a member of the OpenTelemetry organization.
  • If this is a vendor-specific component, I am proposing to contribute and support it as a representative of the vendor.

Code Owner(s)

@Hemansh31

Sponsor (optional)

@atoulme

Additional context

No response

@Hemansh31 Hemansh31 added needs triage New item requiring triage Sponsor Needed New component seeking sponsor labels Jun 13, 2024
@atoulme
Copy link
Contributor

atoulme commented Jun 13, 2024

Can you share what metadata.yaml would look like?

@Hemansh31
Copy link
Author

Hemansh31 commented Jun 15, 2024

type: systemdunitsreceiver
scope_name: otelcol/systemdunitsreceiver


attributes:
  name:
    description: Name of the systemd unit.
    type: string

  type:
    description: The type of systemd unit.
    type: string
    enum: [service, timer, target, socket, mount]
  
  pid:
    description: MainPID of the systemd unit
    type: int


# ActiveState Code
# Value   Meaning   Description
#   0   active        unit is ~
#   1   reloading     unit is ~
#   2   inactive      unit is ~
#   3   failed        unit is ~
#   4   activating    unit is ~
#   5   deactivating  unit is ~


# LoadState Code
# Value   Meaning   Description
#   0   loaded        unit is ~
#   1   stub          unit is ~
#   2   not-found     unit is ~
#   3   bad-setting   unit is ~
#   4   error         unit is ~
#   5   merged        unit is ~
#   6   masked        unit is ~

metrics:
  systemd.service.ActiveState:
    enabled: true
    description: Active State of the systemd service.
    unit: ~
    gauge:
      value_type: int
    attributes: [name, type, pid]
  systemd.service.LoadState:
    enabled: true
    description: Load State of the systemd service.
    unit: ~
    gauge:
      value_type: int
    attributes: [name, type, pid]

@Hemansh31
Copy link
Author

Hemansh31 commented Jun 15, 2024

Can you share what metadata.yaml would look like?

@atoulme shared metadata.yml for systemd unit file receiver, this is just a reference of what the metadata.yml would look like, will need to do some modifications upon design finalization

@atoulme
Copy link
Contributor

atoulme commented Jun 15, 2024

I am interested in sponsoring this component.

@atoulme atoulme added Accepted Component New component has been sponsored and removed Sponsor Needed New component seeking sponsor labels Jun 15, 2024
@Hemansh31
Copy link
Author

Thanks @atoulme, will start working on the PR for this component. I am following the guidelines specified here, do let me know if I am missing something

@crobert-1
Copy link
Member

Removing needs triage as component has been accepted by a sponsor.

@crobert-1 crobert-1 removed the needs triage New item requiring triage label Jul 15, 2024
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Sep 16, 2024
@atoulme atoulme removed the Stale label Oct 16, 2024
@atoulme
Copy link
Contributor

atoulme commented Oct 16, 2024

OK, are we doing this? I can create the skeleton of the receiver for you if you like to get things started.

MovieStoreGuy pushed a commit that referenced this issue Oct 17, 2024
#### Description
Add a new receiver to handle systemd service state reporting as metrics.

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue

#33532
@Hemansh31
Copy link
Author

@atoulme sorry for the delay, this skeleton helps a ton, can I take this forward now ?

@atoulme
Copy link
Contributor

atoulme commented Oct 23, 2024

yes please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Component New component has been sponsored
Projects
None yet
Development

No branches or pull requests

3 participants