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

[receiver/tcpcheck] Implement tcpcheckreceiver #36653

Closed

Conversation

ZenoCC-Peng
Copy link
Contributor

@ZenoCC-Peng ZenoCC-Peng commented Dec 3, 2024

Signed-off-by: [ZenoCC-Peng][[email protected]] (mailto:[email protected])

Description:

To monitor the availability and performance of TCP endpoints.
Use case: TCP network detection plug-in, usually used to monitor whether a TCP port on the local machine is listening, or whether a remote port can be connected

Link to tracking Issue:

#34414

Testing:
(1) PR Includes coverage ~85% in the package with the scraper.
(2) Also includes coverage ~80% in the internal/tcpconfig package

Documentation:

The new receiver includes documentation in receiver/tcpcheckreceiver/README.md and receiver/tcpcheckreceiver/documentation.md.

The metric output looks like the following ...

Resource SchemaURL:
ScopeMetrics #0
ScopeMetrics SchemaURL:
InstrumentationScope otelcol/tcpcheckreceiver 1.0.0
Metric #0
Descriptor:
-> Name: tcpcheck.duration
-> Description: Measures the duration of TCP connection.
-> Unit: ms
-> DataType: Gauge
NumberDataPoints #0
Data point attributes:
-> tcp.endpoint: Str(10.255.88.232:8088)
StartTimestamp: 2024-08-08 08:45:04.75587161 +0000 UTC
Timestamp: 2024-08-08 08:45:05.758205866 +0000 UTC
Value: 1
Metric #1
Descriptor:
-> Name: tcpcheck.status
-> Description: 1 if the TCP client successfully connected, otherwise 0.
-> Unit: 1
-> DataType: Sum
-> IsMonotonic: false
-> AggregationTemporality: Cumulative
NumberDataPoints #0
Data point attributes:
-> tcp.endpoint: Str(10.255.88.232:8088)
StartTimestamp: 2024-08-08 08:45:04.75587161 +0000 UTC
Timestamp: 2024-08-08 08:45:05.758205866 +0000 UTC
Value: 1

Resource SchemaURL:
ScopeMetrics #0
ScopeMetrics SchemaURL:
InstrumentationScope otelcol/tcpcheckreceiver 1.0.0
Metric #0
Descriptor:
-> Name: tcpcheck.duration
-> Description: Measures the duration of TCP connection.
-> Unit: ms
-> DataType: Gauge
NumberDataPoints #0
Data point attributes:
-> tcp.endpoint: Str(127.0.0.1:80)
StartTimestamp: 2024-08-08 08:42:18.432529413 +0000 UTC
Timestamp: 2024-08-08 08:42:19.437666882 +0000 UTC
Value: 0
Metric #1
Descriptor:
-> Name: tcpcheck.error
-> Description: Records errors occurring during TCP check.
-> Unit: {error}
-> DataType: Sum
-> IsMonotonic: false
-> AggregationTemporality: Cumulative
NumberDataPoints #0
Data point attributes:
-> error.message: Str(dial tcp 127.0.0.1:80: connect: connection refused)
StartTimestamp: 2024-08-08 08:42:18.432529413 +0000 UTC
Timestamp: 2024-08-08 08:42:19.437666882 +0000 UTC
Value: 1
Metric #2
Descriptor:
-> Name: tcpcheck.status
-> Description: 1 if the TCP client successfully connected, otherwise 0.
-> Unit: 1
-> DataType: Sum
-> IsMonotonic: false
-> AggregationTemporality: Cumulative
NumberDataPoints #0
Data point attributes:
-> tcp.endpoint: Str(127.0.0.1:80)
StartTimestamp: 2024-08-08 08:42:18.432529413 +0000 UTC
Timestamp: 2024-08-08 08:42:19.437666882 +0000 UTC
Value: 0

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 Dec 28, 2024
@ZenoCC-Peng ZenoCC-Peng deleted the tcp-check-recevier branch January 10, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment