Skip to content

rdkcentral/telemetry

Telemetry 2.0

License C Platform

A lightweight, efficient telemetry framework for RDK (Reference Design Kit) embedded devices.

Overview

Telemetry 2.0 provides real-time monitoring, event collection, and reporting capabilities optimized for resource-constrained embedded devices such as set-top boxes, gateways, and IoT devices.

Key Features

  • ⚑ Efficient: Connection pooling and batch reporting
  • πŸ”’ Secure: mTLS support for encrypted communication
  • πŸ“Š Flexible: Profile-based configuration (JSON/XConf)
  • πŸ”§ Platform-Independent: Multiple architecture support

Architecture Highlights

graph TB
    A[Telemetry Events/Markers] --> B[Profile Matcher]
    B --> C[Report Generator]
    C --> D[HTTP Connection Pool]
    D --> E[XConf Server / Data Collector]
    F[XConf Client] -.->|Config| B
    G[Scheduler] -.->|Triggers| C
Loading

Quick Start

Prerequisites

  • GCC 4.8+ or Clang 3.5+
  • pthread library
  • libcurl 7.65.0+
  • cJSON library
  • OpenSSL 1.1.1+ (for mTLS)

Build

# Clone repository
git clone https://github.com/rdkcentral/telemetry.git
cd telemetry

# Configure
autoreconf -i
./configure 

# Build
make

# Install
sudo make install

Docker Development

Refer to the provided Docker container for a consistent development environment:

https://github.com/rdkcentral/docker-device-mgt-service-test

See Build Setup Guide for detailed build options.

Basic Usage

#include "telemetry2_0.h"

int main(void) {
    // Initialize telemetry
    if (t2_init() != 0) {
        fprintf(stderr, "Failed to initialize telemetry\n");
        return -1;
    }
    
    // Send a marker event
    t2_event_s("SYS_INFO_DeviceBootup", "Device started successfully");
    
    // Cleanup
    t2_uninit();
    return 0;
}

Compile: gcc -o myapp myapp.c -ltelemetry

Documentation

πŸ“š Complete Documentation

Key Documents

Component Documentation

Individual component documentation is in source/docs/:

Project Structure

telemetry/
β”œβ”€β”€ source/              # Source code
β”‚   β”œβ”€β”€ bulkdata/       # Profile and marker management
β”‚   β”œβ”€β”€ protocol/       # HTTP/RBUS communication
β”‚   β”œβ”€β”€ scheduler/      # Report scheduling
β”‚   β”œβ”€β”€ xconf-client/   # Configuration retrieval
β”‚   β”œβ”€β”€ dcautil/        # Log marker utilities
β”‚   └── test/           # Unit tests (gtest/gmock)
β”œβ”€β”€ include/            # Public headers
β”œβ”€β”€ config/             # Configuration files
β”œβ”€β”€ docs/               # Documentation
β”œβ”€β”€ containers/         # Docker development environment
└── test/               # Functional tests

Configuration

Profile Configuration

Telemetry uses JSON profiles to define what data to collect:

{
  "Profile": "RDKB_BasicProfile",
  "Version": "1.0.0",
  "Protocol": "HTTP",
  "EncodingType": "JSON",
  "ReportingInterval": 300,
  "Parameters": [
    {
      "type": "dataModel",
      "name": "Device.DeviceInfo.Manufacturer"
    },
    {
      "type": "event",
      "eventName": "bootup_complete"
    }
  ]
}

See Profile Configuration Guide for details.

Environment Variables

Variable Description Default
T2_ENABLE_DEBUG Enable debug logging 0
T2_PROFILE_PATH Default profile directory /etc/DefaultT2Profile.json
T2_XCONF_URL XConf server URL -
T2_REPORT_URL Report upload URL -

Development

Running Tests

# Unit tests
make check

# Functional tests
cd test
./run_ut.sh

# Code coverage
./cov_build.sh

Development Container

Use the provided Docker container for consistent development: https://github.com/rdkcentral/docker-device-mgt-service-test

cd docker-device-mgt-service-test
docker compose up -d

A directory above the current directory is mounted as a volume in /mnt/L2_CONTAINER_SHARED_VOLUME . Login to the container as follows:

docker exec -it native-platform /bin/bash
cd /mnt/L2_CONTAINER_SHARED_VOLUME/telemetry
sh test/run_ut.sh

See Docker Development Guide for more details.

Platform Support

Telemetry 2.0 is designed to be platform-independent and has been tested on:

  • RDK-B (Broadband devices)
  • RDK-V (Video devices)
  • Linux (x86_64, ARM, ARM64)
  • Yocto Project builds

See Platform Porting Guide for porting to new platforms.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all L1 and L2 tests pass
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

Code Style

  • Follow existing C code style and ensure astyle formatting and checks pass with below commands
          find . -name '*.c' -o -name '*.h' | xargs astyle --options=.astylerc
          find . -name '*.orig' -type f -delete
  • Use descriptive variable names
  • Document all public APIs
  • Add unit tests for new functions
  • Add functional tests for new features

See Coding Guidelines for details.

Troubleshooting

Common Issues

Q: Telemetry not sending reports

  • Check network connectivity
  • Verify XConf URL configuration
  • Review logs in /var/log/telemetry/

Q: High memory usage

  • Reduce number of active profiles
  • Decrease reporting intervals
  • Check for memory leaks with valgrind

Q: Build errors

  • Ensure all dependencies installed
  • Check compiler version (GCC 4.8+)
  • Review build logs for missing libraries

See Troubleshooting Guide for more solutions.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Acknowledgments

  • RDK Management LLC
  • RDK Community Contributors
  • Open Source Community

Contact

Changelog

See CHANGELOG.md for version history and release notes.


Built for the RDK Community

About

No description or website provided.

Topics

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
COPYING

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors