client

package
v0.0.0-...-dbadf91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

README

Language Detection Exporter Client

Overview

This code comprises the language exporter client implemented by container-integrations for APM libraries injecting. This client is responsible for sending process language information from process events to the Cluster-Agent for processing.

Mechanism

The client subscribe to process and pod events in workloadmeta. It handles only new processes and pod deletions. The process events capture the language information of a running process with the corresponding container id. The client resolves the associated pod using workloadmeta, including its unique identifier and its detected language.

There are two main periods the client operates in terms of sending data to the Cluster-Agent:

  1. The freshDataPeriod that sends information about new updated pods as soon as possible. It awaits a few seconds, such that there is a high chance that all processes in a pod are scanned and thus tries limiting the amount of messages sent.
  2. The periodical flush period is dedicated to sending accumulated data in intervals of a few minutes. This mechanism ensures a retry.

Moreover, since there can be a race between the Kubelet and the process-check, if the pod of a given process is not found, the client waits until the kubelet data is pulled before trying again.

For better observability, it uses telemetry to emits metrics, including number of pods processed, time taken to send data etc.

Mermaid Diagram

Below is a simple sequence diagram visualizing the client's communication with Cluster-Agent:

sequenceDiagram
    Client->>workloadmeta: Subscribe to pod & process events
    workloadmeta-->>Client: Send events
    activate Client
    Client->>+Client: Process events, update currentBatch
    Note over Client: Every 'freshly updated pods period' (10s)
    Client->>Client: Get freshlyUpdatedPods batch from currentBatch
    Client->>Cluster-Agent: Send fresh updates
    Note over Client: Every 'periodic flush period'
    Client->>Client: Get all data from currentBatch (10m)'runningMetricPeriod'
    deactivate Client

Note

  • This code assumes that a pod has a single and stable owner.
  • For more information about the language detection and library injection feature, refer to this document.

Documentation

Overview

Package client implements a component to send process metadata to the Cluster-Agent

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface{}

Component is the component interface.

Directories

Path Synopsis
Package clientimpl holds the client to send data to the Cluster-Agent
Package clientimpl holds the client to send data to the Cluster-Agent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL