> ## Documentation Index
> Fetch the complete documentation index at: https://otel.fyi/llms.txt
> Use this file to discover all available pages before exploring further.

# Tcpcheck

> OpenTelemetry receiver for Tcpcheck

# Tcpcheck Receiver

![Status](https://img.shields.io/badge/status-alpha-red)

**Available in:** `contrib`

**Maintainers:** [@atoulme](https://github.com/atoulme), [@michael-burt](https://github.com/michael-burt), [@chengchuanpeng](https://github.com/chengchuanpeng), [@yanfeng1992](https://github.com/yanfeng1992)

**Source:** [opentelemetry-collector-contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/tcpcheckreceiver)

## Supported Telemetry

![Metrics](https://img.shields.io/badge/metrics-alpha-green)

## 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

```yaml theme={null}
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](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/tcpcheckreceiver/config.go) with detailed sample configurations [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/tcpcheckreceiver/testdata/config.yaml).

## Metrics

Details about the metrics produced by this receiver can be found in [metadata.yaml](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/tcpcheckreceiver/metadata.yaml)

## Metrics

| Metric Name | Description | Unit | Type | Attributes |
| - | - | - | - | - |
| ✅ `tcpcheck.duration` | Measures the duration of TCP connection. | ms | Gauge | tcpcheck.endpoint |
| ✅ `tcpcheck.error` | Records errors occurring during TCP check. | \{error} | Counter | tcpcheck.endpoint, error.code |
| ✅ `tcpcheck.status` | 1 if the TCP client successfully connected, otherwise 0. | 1 | Gauge | tcpcheck.endpoint |

## Attributes

| Attribute Name | Description | Type | Values |
| - | - | - | - |
| `error.code` | Error code recorded during check | string | `connection_refused`, `connection_timeout`, `invalid_endpoint`, `network_unreachable`, `unknown_error` |
| `tcpcheck.endpoint` | TCP endpoint | string | |

## Configuration

### Example Configuration

```yaml theme={null}
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-10-05*
