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

# Yanggrpc

> OpenTelemetry receiver for Yanggrpc

# Yanggrpc Receiver

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

**Available in:** `contrib`

**Maintainers:** [@atoulme](https://github.com/atoulme)

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

## Supported Telemetry

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

## Overview

The **YANG gRPC Receiver** collects Model-Driven Telemetry (MDT) from network devices (primarily Cisco) via gRPC Dial-out. It transforms complex Cisco KV-GPB (Key-Value Google Protocol Buffers) data into standard OpenTelemetry metrics, specifically optimized for high-performance analysis in **Splunk**.

## Key Features

* **Context-Aware Processing**: Automatically discovers dimensions (labels) like Interface names, VRF IDs, or BGP neighbors by traversing the telemetry tree.
* **YANG-Driven Mapping**: Uses Cisco YANG models to distinguish between Counters (monotonic sums) and Gauges (instantaneous values).
* **Smart Fallback**: Works out-of-the-box using naming heuristics (detecting keys like `name`, `id`, `address`) even if local YANG files are not provided.
* **OTLP Compliance**: Normalizes all Cisco numeric types into `float64` and handles string values as descriptive `_info` metrics.
* **Security Hardening**: Includes built-in support for client IP allow-listing and ingestion rate limiting.

***

### Example Configuration

Add this receiver to your OpenTelemetry Collector configuration:

```yaml theme={null}
receivers:
  yang_grpc:
    endpoint: "0.0.0.0:57000"
    yang:
      module_paths:
        - "/etc/otelcol/yang/cisco/xe"
        - "/etc/otelcol/yang/standard/ietf"
    security:
      allowed_clients: ["10.0.0.0/8", "192.168.1.0/24"]
      rate_limiting:
        enabled: true
        requests_per_second: 100
        burst_size: 50

exporters:
  splunk_hec:
    endpoint: "https://your-splunk-instance:8088/services/collector"
    token: "${SPLUNK_HEC_TOKEN}"
    index: "network_metrics"

service:
  pipelines:
    metrics:
      receivers: [yang_grpc]
      processors: [batch]
      exporters: [splunk_hec]
```

***

## gRPC Configuration

See [configgrpc](https://pkg.go.dev/go.opentelemetry.io/collector/config/configgrpc).

## Default Configuration

```yaml theme={null}
yang_grpc:
  endpoint: localhost:57500
  transport: tcp
  keepalive:
    server_parameters:
      time: 30s
      timeout: 10s
  max_concurrent_streams: 100
  max_recv_msg_size_mib: 4
```

## Security Configuration (security)

* `rate_limiting`: enabled (default: false), requests\_per\_second (100.0), burst\_size (10).
* `access_control`: allowed\_clients (list of IP/CIDR), max\_connections (1000).

## YANG Parser Settings (yang)

* `enable_rfc_parser`: Enable RFC 6020/7950 compliant parsing.
* `cache_modules`: Local directories containing Cisco/IETF `.yang` files for accurate parsing. Cache discovered YANG modules to reduce CPU overhead.

## Production Deployment Example

```YAML theme={null}
yang_grpc:
  endpoint: "0.0.0.0:57500"
  tls:
    enabled: true
    cert_file: "/etc/otel/certs/server.crt"
    key_file: "/etc/otel/certs/server.key"
  security:
    rate_limiting:
      enabled: true
    allowed_clients: 
      - "10.0.0.0/8"
  yang:
    cache_modules: true
```

***

# Example OTLP Output

When processing Cisco ARP telemetry data, the receiver generates structured OTLP metrics:

### Metric Name: cisco.content.arp-oper.type\_info

Value: 1.0 (Info Metric)

### Attributes:

* interface: Vlan200
* vrf: Default
* address: 10.10.10.1
* yang.module: Cisco-IOS-XE-arp-oper
* cisco.node\_id: Switch-Core-01
* cisco.subscription\_id: 112

## Configuration

### Example Configuration

```yaml theme={null}
yang_grpc/default:
  endpoint: localhost:57500
  transport: tcp
  keepalive:
    server_parameters:
      time: 30s
      timeout: 10s
  max_concurrent_streams: 100
  max_recv_msg_size_mib: 4
  security:
    connection_timeout: 30s
    enable_metrics: true
    rate_limiting:
      burst_size: 10
      cleanup_interval: 1m0s
      enabled: false
      requests_per_second: 100
  yang:
    cache_modules: true
    enable_rfc_parser: true
    max_modules: 1000
yang_grpc/prod:
  endpoint: "0.0.0.0:57500"
  # TLS/mTLS Configuration
  tls:
    enabled: true
    cert_file: "/etc/otel/certs/server.crt"
    key_file: "/etc/otel/certs/server.key"
    ca_file: "/etc/otel/certs/ca.crt"
    client_auth_type: "RequireAndVerifyClientCert"
    min_version: "1.2"
    max_version: "1.3"
    reload_interval: 5m

  # Security & Rate Limiting
  security:
    rate_limiting:
      enabled: true
      requests_per_second: 100.0
      burst_size: 10
      cleanup_interval: 1m
    allowed_clients:
      - "10.0.0.0/8"
      - "192.168.0.0/16"
    max_connections: 1000
    connection_timeout: 30s
    enable_metrics: true

    # Performance Settings
    max_concurrent_streams: 100
    max_recv_msg_size_mib: 4

    # Keep-Alive Configuration
    keepalive:
      server_parameters:
        time: 30s
        timeout: 10s

    # YANG Parser Configuration
    yang:
      enable_rfc_parser: true
      cache_modules: true
      max_modules: 1000
```

***

*Last generated: 2026-07-06*
