Building Statsd - linux-on-ibm-z/docs GitHub Wiki

Building Statsd

The instructions provided below specify the steps to build Statsd version 0.10.2 on Linux on IBM Z for the following distributions:

  • RHEL (8.10, 9.6, 9.7, 9.8, 10.0, 10.1, 10.2)
  • SLES (15 SP7, 16)
  • Ubuntu (22.04, 24.04)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it

Step 1: Build using script

If you want to build Statsd using manual steps, go to STEP 2.

Use the following commands to build Statsd using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Statsd/0.10.2/build_statsd.sh

# Build Statsd
bash build_statsd.sh    [Provide -t option for executing build with tests]

If the build completes successfully, go to STEP 5. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.

Step 2: Install dependencies

export SOURCE_ROOT=/<source_root>/
  • RHEL (8.10, 9.6, 9.7, 9.8, 10.0, 10.1, 10.2)

     sudo yum install -y git wget tar unzip hostname make gcc-c++ xz gzip python3 nmap procps
    
  • SLES (15 SP7, 16)

      sudo zypper install -y git wget tar unzip hostname make gcc-c++ xz gzip python3 nmap procps
    
  • Ubuntu (22.04, 24.04)

     sudo apt-get update
     sudo apt-get install -y git wget tar unzip hostname python3 g++ make xz-utils
    
  • Install Nodejs

    cd $SOURCE_ROOT
    NODE_VERSION=v18.17.1
    wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-s390x.tar.xz
    chmod ugo+r node-${NODE_VERSION}-linux-s390x.tar.xz
    sudo tar -C /usr/local -xf node-${NODE_VERSION}-linux-s390x.tar.xz
    export PATH=$PATH:/usr/local/node-${NODE_VERSION}-linux-s390x/bin
    node -v
    

Step 3: Install Statsd

  • Download Statsd source code

    cd $SOURCE_ROOT
    git clone https://github.com/etsy/statsd.git
    cd statsd
    git checkout v0.10.2
    
  • Install required npm dependencies

    npm install
    

Note: User can run npm audit fix command to automatically install compatible updates to vulnerable dependencies.

Step 4: Testing (Optional)

  • Run test cases
    cd $SOURCE_ROOT/statsd/
    ./run_tests.js
    

Note: For starting the statsd daemon, usage instructions and examples, refer to the official StatsD Manual installation and StatsD Usage Guide.

References: