{"id":38617932,"url":"https://github.com/rajsinghtech/fleet-telemetry-consumer","last_synced_at":"2026-01-17T08:51:09.789Z","repository":{"id":258719515,"uuid":"862107184","full_name":"rajsinghtech/fleet-telemetry-consumer","owner":"rajsinghtech","description":"Example repo of consuming a teslas fleet-telemetry","archived":false,"fork":false,"pushed_at":"2025-09-04T18:46:39.000Z","size":218,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-04T20:38:48.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rajsinghtech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-24T03:45:13.000Z","updated_at":"2024-11-10T04:14:15.000Z","dependencies_parsed_at":"2025-08-14T01:12:10.402Z","dependency_job_id":"88df8d76-7b83-44b6-bb20-677845fa7a07","html_url":"https://github.com/rajsinghtech/fleet-telemetry-consumer","commit_stats":null,"previous_names":["rajsinghtech/fleet-telemetry-consumer"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/rajsinghtech/fleet-telemetry-consumer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajsinghtech%2Ffleet-telemetry-consumer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajsinghtech%2Ffleet-telemetry-consumer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajsinghtech%2Ffleet-telemetry-consumer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajsinghtech%2Ffleet-telemetry-consumer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rajsinghtech","download_url":"https://codeload.github.com/rajsinghtech/fleet-telemetry-consumer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajsinghtech%2Ffleet-telemetry-consumer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T08:51:09.678Z","updated_at":"2026-01-17T08:51:09.769Z","avatar_url":"https://github.com/rajsinghtech.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fleet Telemetry Consumer\n\n![Fleet Telemetry Consumer](https://your-image-url.com/logo.png)\n\n## Overview\n\nFleet Telemetry Consumer is a robust application designed to consume vehicle telemetry data from Tesla's [Fleet Telemetry project](https://github.com/teslamotors/fleet-telemetry). It processes the data using Protobuf and exports metrics to Prometheus, enabling real-time monitoring and analysis. The application is containerized with Docker and optimized for deployment in Kubernetes environments using Kustomize.\n\n## Features\n\n- **Kafka Consumer**: Efficiently consumes messages from a Kafka topic (`tesla_V` by default) containing vehicle telemetry data from Tesla’s Fleet Telemetry project.\n- **Protobuf Processing**: Deserializes Protobuf data defined in Tesla's [vehicle_data.proto](https://github.com/teslamotors/fleet-telemetry/blob/main/protos/vehicle_data.proto) to process telemetry information such as location, door status, and various sensor values.\n- **Prometheus Metrics**: Exposes vehicle telemetry data as Prometheus metrics, facilitating seamless real-time monitoring.\n- **Docker \u0026 Kubernetes**: Fully Dockerized for easy containerization and equipped with `Kustomize` support for streamlined Kubernetes deployments.\n- **Dashboard Integration**: Includes Grafana dashboards for visualizing telemetry data, enabling comprehensive insights into fleet operations.\n\n## Prerequisites\n\nBefore setting up the Fleet Telemetry Consumer, ensure you have the following installed and configured:\n\n- **Docker**: To build and run the application containers.\n- **Docker Compose**: For orchestrating multi-container Docker applications.\n- **Kubernetes**: For deploying the application in a cluster environment.\n- **Kustomize**: To manage Kubernetes configurations.\n- **Kafka**: A running Kafka cluster with the topic `tesla_V`.\n- **Prometheus**: To scrape and store metrics exposed by the application.\n- **Grafana**: For visualizing the metrics collected by Prometheus.\n\n## Tesla's Fleet Telemetry Data\n\nThe application consumes telemetry data structured according to Tesla's [Protobuf definition](https://github.com/teslamotors/fleet-telemetry/blob/main/protos/vehicle_data.proto). The Protobuf message `Payload` includes fields for various vehicle data such as:\n\n- `LocationValue`: GPS coordinates (latitude, longitude)\n- `DoorValue`: Open/closed status of the vehicle’s doors\n- `DoubleValue`, `FloatValue`, `IntValue`, etc.: Different sensor values\n- `TimeValue`: Timestamp data related to telemetry events\n\nThe application extracts and processes these fields, converting them into Prometheus metrics for monitoring and analysis.\n\n## Configuration\n\nThe application requires a configuration file in YAML format. This file contains settings for Kafka consumer configuration and AWS integration. By default, the app looks for `examples/config.yaml`.\n\n### Example `config.yaml`:\n\n```yaml\nbootstrap.servers: \"localhost:9092\"\ngroup.id: \"fleet-telemetry-consumer\"\nauto.offset.reset: \"earliest\"\naws:\n  access_key_id: \"YOUR_AWS_ACCESS_KEY_ID\"\n  secret_access_key: \"YOUR_AWS_SECRET_ACCESS_KEY\"\n  bucket:\n    name: \"ceph-tesla\"\n    host: \"rook-ceph-rgw-my-store.rook-ceph.svc.cluster.local\"\n    port: 80\n    protocol: \"http\"\n    region: \"us-east-1\"\n  enabled: true\n```\n\n## Build and Run\n\n### Using Makefile\n\nThe project includes a `Makefile` to simplify build and run commands.\n\n#### Build the Docker Image\n\n```bash\nmake build\n```\n\n#### Run the Application with Docker Compose\n\n```bash\nmake run\n```\n\n### Docker Instructions\n\n#### Build Docker Image Manually\n\n```bash\ndocker buildx build --platform linux/amd64 --load -t fleet-telemetry-consumer .\n```\n\n#### Run with Docker Compose\n\n```bash\ndocker compose up --build\n```\n\n### Kubernetes Deployment\n\nDeploy the application in a Kubernetes environment using Kustomize.\n\n#### Setup Kustomization\n\nEnsure your `kustomization.yaml` includes the necessary resources:\n\n```yaml\napiVersion: kustomize.config.k8s.io/v1beta1\nkind: Kustomization\n\nresources:\n  - ./fleet-telemetry-consumer\n  - ./dashboards\n```\n\n#### Apply the Configuration\n\n```bash\nkubectl apply -k kustomization/\n```\n\nThis command will deploy the Fleet Telemetry Consumer into your Kubernetes cluster along with the configured Grafana dashboards.\n\n## Prometheus Metrics\n\nThe consumer exposes metrics at `/metrics` on port `2112`. Prometheus can scrape this endpoint to monitor various vehicle telemetry data, including:\n\n- **Vehicle Location**: GPS coordinates (latitude, longitude)\n- **Door States**: Open or closed status of each door\n- **Time and Speed Metrics**: Timestamps and speed-related data\n- **Sensor Data**: Boolean and numerical telemetry values\n\n### Sample Prometheus Query\n\n```promql\nvehicle_data{field=\"Latitude\"}\n```\n\n## Grafana Dashboards\n\nThe application includes pre-configured Grafana dashboards for visualizing telemetry data.\n\n- **Vehicle Locations**: Displays real-time locations of vehicles on a geomap.\n- **Odometer**: Shows odometer readings per vehicle.\n- **Battery Level**: Monitors battery levels across the fleet.\n- **Temperature Readings**: Tracks inside and outside temperatures.\n- **Vehicle Speed**: Visualizes speed metrics.\n- **Gear Status**: Displays current gear states.\n- **Battery Metrics**: Provides detailed battery performance insights.\n\n### Importing Dashboards\n\nEnsure that the dashboards are included in the Kubernetes deployment by verifying the `kustomization/dashboards/vehicle-data.json` file is correctly referenced.\n\n## Examples\n\n### Example Data\n\nSample telemetry data can be found in `examples/data.json`. This data follows the structure defined by Tesla's Protobuf schema and is used for testing and development purposes.\n\n### Commands\n\nCommon commands for managing the application:\n\n```bash\n# Ensure dependencies are up to date\ngo mod tidy\n\n# Run the application with a specific configuration\ngo run main.go -config examples/config.yaml\n\n# Set environment variables for AWS integration\nexport AWS_ACCESS_KEY_ID=your_access_key_id\nexport AWS_SECRET_ACCESS_KEY=your_secret_access_key\nexport AWS_BUCKET_HOST=rook-ceph-rgw-my-store.rook-ceph.svc.cluster.local\nexport AWS_BUCKET_NAME=ceph-tesla\nexport AWS_BUCKET_PORT=80\nexport AWS_BUCKET_PROTOCOL=http\nexport AWS_BUCKET_REGION=us-east-1\nexport AWS_ENABLED=true\n```\n\n## Development\n\n### Dependencies\n\nThe project manages dependencies using Go Modules. Ensure all dependencies are installed by running:\n\n```bash\ngo mod download\n```\n\n### Dockerfile\n\nThe `Dockerfile` is multi-staged to optimize build times and reduce the final image size.\n\n```dockerfile\n# syntax=docker/dockerfile:1\n\nFROM golang:1.22.5-bullseye AS build\n\n# Install build dependencies and librdkafka dependencies\nRUN apt-get update \u0026\u0026 apt-get install -y \\\n    build-essential \\\n    wget \\\n    libssl-dev \\\n    libsasl2-dev \\\n    libzstd-dev \\\n    pkg-config \\\n    liblz4-dev \\\n    \u0026\u0026 rm -rf /var/lib/apt/lists/*\n\n# Build and install librdkafka from source\nENV LIBRDKAFKA_VERSION=1.9.2\nRUN wget https://github.com/edenhill/librdkafka/archive/refs/tags/v${LIBRDKAFKA_VERSION}.tar.gz \u0026\u0026 \\\n    tar -xzf v${LIBRDKAFKA_VERSION}.tar.gz \u0026\u0026 \\\n    cd librdkafka-${LIBRDKAFKA_VERSION} \u0026\u0026 \\\n    ./configure --prefix=/usr \u0026\u0026 \\\n    make \u0026\u0026 make install \u0026\u0026 \\\n    ldconfig\n\nWORKDIR /go/src/fleet-telemetry-consumer\n\nCOPY go.mod go.sum ./\nRUN go mod download\n\nCOPY . .\n\n# Build with dynamic linking\nRUN go build -tags dynamic -o /go/bin/fleet-telemetry-consumer\n\n# Use a minimal base image\nFROM debian:bullseye-slim\n\nWORKDIR /\n\n# Install runtime dependencies\nRUN apt-get update \u0026\u0026 apt-get install -y \\\n    libssl1.1 \\\n    libsasl2-2 \\\n    libzstd1 \\\n    liblz4-1 \\\n    \u0026\u0026 rm -rf /var/lib/apt/lists/*\n\nCOPY --from=build /go/bin/fleet-telemetry-consumer /fleet-telemetry-consumer\n\nENTRYPOINT [\"/fleet-telemetry-consumer\"]\n```\n\n## Contribution\n\nContributions are welcome! If you'd like to improve Fleet Telemetry Consumer, please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bugfix.\n3. Commit your changes with clear and descriptive messages.\n4. Push your branch to your forked repository.\n5. Open a pull request detailing your changes.\n\nPlease ensure your code adheres to the project's coding standards and passes all tests.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\n*For any questions or support, please open an issue on the [GitHub repository](https://github.com/rajsinghtech/fleet-telemetry-consumer/issues).*","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajsinghtech%2Ffleet-telemetry-consumer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajsinghtech%2Ffleet-telemetry-consumer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajsinghtech%2Ffleet-telemetry-consumer/lists"}