Skip to main content

Tcpcheck Receiver

Status Available in: contrib Maintainers: @atoulme, @michael-burt, @chengchuanpeng, @yanfeng1992 Source: opentelemetry-collector-contrib

Supported Telemetry

Metrics

Overview

Configuration

Note: This receiver was renamed from tcpcheck to tcp_check to match the snake_case naming convention. The deprecated component type tcpcheck is still accepted as an alias and will log a deprecation warning.
The following settings are required:
  • endpoint
The following settings are optional:
  • collection_interval (default = 60s): This receiver collects metrics on an interval. Valid time units are ns, us (or µs), ms, s, m, h.

Example Configuration

Targets are
receivers:
  tcp_check:
    targets:
      - endpoint: example.com:443
        dialer:
          timeout: 15s
      - endpoint: foobar.com:8080
        dialer:
          timeout: 15s
      - endpoint: localhost:10901
The full list of settings exposed for this receiver are documented here with detailed sample configurations here.

Metrics

Details about the metrics produced by this receiver can be found in metadata.yaml

Metrics

Metric NameDescriptionUnitTypeAttributes
tcpcheck.durationMeasures the duration of TCP connection.msGaugetcpcheck.endpoint
tcpcheck.errorRecords errors occurring during TCP check.{errors}Countertcpcheck.endpoint, error.code
tcpcheck.status1 if the TCP client successfully connected, otherwise 0.1Gaugetcpcheck.endpoint

Attributes

Attribute NameDescriptionTypeValues
error.codeError code recorded during checkstringconnection_refused, connection_timeout, invalid_endpoint, network_unreachable, unknown_error
tcpcheck.endpointTCP endpointstring

Configuration

Example Configuration

receivers:
  tcp_check:
    collection_interval: 1m
    initial_delay: 1s
    targets:
      - endpoint: "google.com:443"
        dialer:
          timeout: 3s
      - endpoint: "localhost:8080"
        dialer:
          timeout: 5s

Last generated: 2026-06-01