This document describes how to setup the OpenTelemetry Collector to export telemetry to Firetiger.

For the OpenTelemetry Collector to export data to Firetiger, we need to configure the Firetiger OpenTelemetry Endpoint as an Exporter in the Collector’s configuration

First: Get Firetiger connection details

The following shell script will output the necessary OpenTelemetry ingestion endpoint and authorization header. Replace variables at the top as appropriate.

GCP

#!/bin/bash

export BUCKET_NAME=my-firetiger-bucket
export PROJECT_ID=my-firetiger-project
export FIRETIGER_PASSWORD=$(gcloud --project $PROJECT_ID secrets versions access latest --secret $BUCKET_NAME-basic-auth-ingest)

export AUTHORIZATION=$(echo -n $BUCKET_NAME:$FIRETIGER_PASSWORD | base64)
export INGEST_ENDPOINT="<https://ingest.$>(echo $BUCKET_NAME | sed 's/[^a-zA-Z0-9-]/-/g').firetigerapi.com:443"

echo "OTEL Endpoint: ${INGEST_ENDPOINT}"
echo "Headers"
echo "-------"
echo "Authorization: Basic ${AUTHORIZATION}"

AWS

#!/bin/bash

export BUCKET_NAME=my-firetiger-bucket
export ACCOUNT_ID=12345
export AWS_REGION=us-west-2  # Add your appropriate region here

# Get the credentials from assume-role and store them in variables
CREDS=$(aws sts assume-role \\
  --role-arn arn:aws:iam::${ACCOUNT_ID}:role/CrossAccountAccessForFiretiger \\
  --role-session-name firetiger \\
  --output json)

export AWS_ACCESS_KEY_ID=$(echo $CREDS | jq -r .Credentials.AccessKeyId)
export AWS_SECRET_ACCESS_KEY=$(echo $CREDS | jq -r .Credentials.SecretAccessKey)
export AWS_SESSION_TOKEN=$(echo $CREDS | jq -r .Credentials.SessionToken)

if [ -z "$AWS_ACCESS_KEY_ID" ] || [ -z "$AWS_SECRET_ACCESS_KEY" ] || [ -z "$AWS_SESSION_TOKEN" ]; then
  echo "Failed to obtain valid credentials"
  exit 1
fi

# Get the secret using the environment variables (no profile needed)
export FIRETIGER_PASSWORD=$(aws secretsmanager get-secret-value \\
  --secret-id firetiger/ingest/basic-auth@${BUCKET_NAME} \\
  --query SecretString --output text)

export AUTHORIZATION=$(echo -n $BUCKET_NAME:$FIRETIGER_PASSWORD | base64)
export INGEST_ENDPOINT="<https://ingest.$>(echo $BUCKET_NAME | sed 's/[^a-zA-Z0-9-]/-/g').firetigerapi.com:443"
echo "OTEL Endpoint: ${INGEST_ENDPOINT}"
echo "Headers"
echo "-------"
echo "Authorization: Basic ${AUTHORIZATION}"

Second: Send telemetry!

Example telemetrygen invocation:

# Install telemetrygen if you don't have it
# go install github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen@latest

ENDPOINT_HOSTNAME=$(echo "$INGEST_ENDPOINT" | sed 's|^https://\\(.*\\):443$|\\1|')                                                                                                                                                                                                                                                          /13:51
~/go/bin/telemetrygen metrics --otlp-endpoint=$ENDPOINT_HOSTNAME --otlp-http --otlp-header "Authorization=\\"Basic $AUTHORIZATION\\"" --rate=5 --duration=30s --service=firetiger-test-service

Example OpenTelemetry config.yaml:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: "0.0.0.0:4317"
      http:
        endpoint: "0.0.0.0:4318"

processors:
  batch:

exporters:
  otlphttp/firetiger:
    endpoint: ${INGEST_ENDPOINT}
    tls:
      insecure: false
    headers:
      "User-Agent": "opentelemetry-collector"
      "Authorization": Basic ${AUTHORIZATION}"

service:
  pipelines:
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/firetiger]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/firetiger]
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/firetiger]

For more information on how to configure the OpenTelemetry Collector, please refer to the official docs: https://opentelemetry.io/docs/collector/configuration