[receiver/tcpcheck] Implement tcpcheckreceiver #36653
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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