Codebase

Navigate the Codebase using the tree view. Use the filters to highlight where various files are grouped to aid understanding.

Getting Started Commands

Project Structure

Below is a short description of the key directories of the project to aid you when understanding where key files are located.

cmd/ - This directory contains the Go source code for the Thanos command-line interface and its related components.
docs/ - This directory contains documentation for Thanos, including blog posts, components documentation, contributing guidelines, and operating instructions.
examples/ - This directory contains example configurations and usage scenarios for Thanos.
internal/ - This directory contains the Go source code for the internal components of Thanos, such as Cortex.
mixin/ - This directory contains reusable components and configurations for Thanos, written in Libsonnet and JSONnet.
pkg/ - This directory contains the Go packages for Thanos, including alerting, API, block management, cache, client configuration, compacting, component, deduplication, discovery, errors handling, exemplars, external annotations, gRPC, HTTP, kingpin, logging, metadata, model, pool, prober, Prometheus integration, querying, query frontend, query sharding, receive, reloader, replication, rules, run utilities, server, shipper, store, and utilities.
testdata/ - This directory contains test data used by the Thanos project.

Entrypoints

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

/cmd/thanos/main.go - This file contains the main entrypoint for the Thanos project, which includes the `main` function that initializes the application, as well as helper functions such as `interrupt` and `reload` for handling signals and configuration changes.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

/scripts/cfggen/main.go - This file contains the main entrypoint for the Thanos configuration generator script. Functions include `init` for initializing the generator, `name` for setting the output file name, `main` for executing the generation process, and helper functions `checkForOmitEmptyTagOption` and `checkForOmitEmptyTagOptionRec` for handling configuration options.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

/scripts/copyright/copyright.go - This script file is responsible for applying the Thanos project license to generated proto and Go files. It includes functions such as `applyLicenseToProtoAndGo`, `writeLicence`, and `main` for executing the licensing process.