prometheus/scripts/gentextlex.sh
bwplotka adc4150597 om2: add om2 complex type format for PoC
This change is for demo purposes, exploring the benefits (and downsides)
for the complex type format for OM2 captured in
https://github.com/prometheus/docs/pull/2679.

This assumes Prometheus stores NS and NHCB (and NH) going forward (for
best case efficiency), but is expected to work for classic mode too with
little overhead (benchmarks will tell us).

Part of the PromCon talk we do with @krajorama

Signed-off-by: bwplotka <bwplotka@gmail.com>
2025-10-07 12:37:22 +01:00

26 lines
529 B
Bash
Executable File

#!/usr/bin/env bash
#
# Generate all protobuf bindings.
# Run from repository root.
set -e
set -u
if ! [[ "$0" =~ "scripts/gentextlex.sh" ]]; then
echo "must be run from repository root"
exit 255
fi
pushd "internal/tools"
INSTALL_PKGS="modernc.org/golex"
for pkg in ${INSTALL_PKGS}; do
GO111MODULE=on go install "$pkg"
done
popd
echo "generating lex code"
pushd model/textparse
golex -o=promlex.l.go promlex.l
golex -o=openmetricslex.l.go openmetricslex.l
golex -o=openmetrics2lex.l.go openmetrics2lex.l
popd