### Install OpenTelemetry Go SDK and Exporters Source: https://docs.kloudmate.com/guides/opentelemetry/go Installs the OpenTelemetry Go SDK, along with the stdouttrace and otlptracehttp exporters, using go get. ```bash go get go.opentelemetry.io/otel/sdk \ go.opentelemetry.io/otel/exporters/stdout/stdouttrace \ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp ``` -------------------------------- ### Verify PostgreSQL Monitoring Setup Source: https://docs.kloudmate.com/database-monitoring/direct-database-monitoring These SQL queries, run as the `kloudmate` user, verify the installation of `pg_stat_statements`, Kloudmate functions, and check key configuration parameters like `track_activity_query_size` and `track_io_timing`. ```sql -- Check pg_stat_statements is loaded SELECT count(*) FROM pg_stat_statements; ``` ```sql -- Check functions exist SELECT routine_name FROM information_schema.routines WHERE routine_schema = 'kloudmate'; ``` ```sql -- Test pg_stat_activity wrapper SELECT count(*) FROM kloudmate.pg_stat_activity(); ``` ```sql -- Test explain SELECT * FROM kloudmate.explain_statement('SELECT 1'); ``` ```sql -- Check track_activity_query_size SHOW track_activity_query_size; ``` ```sql -- Check track_io_timing SHOW track_io_timing; ``` -------------------------------- ### Example Express Application with Winston Source: https://docs.kloudmate.com/guides/logs/send-winston-logs-with-opentelemetry-nodejs An example Express application demonstrating basic Winston logging setup. ```typescript import express from 'express' import { createLogger, transports } from 'winston' const logger = createLogger({ transports: [new transports.Console()], }) const app = express() const port = 5000 app.get('/', (req: any, res: any) => { logger.info({ msg: 'received request', query: req.query }) res.send('hello world') }) app.listen(port, () => { logger.info(`Server is running at http://localhost:${port}`) }) ``` -------------------------------- ### Install OpenTelemetry Go Packages Source: https://docs.kloudmate.com/apm-and-tracing/manual-instrumentation/go Installs the core OpenTelemetry Go packages and the OTLP HTTP exporter. Ensure you have Go installed and configured. ```bash go get go.opentelemetry.io/otel \ go.opentelemetry.io/otel/sdk \ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp ``` -------------------------------- ### Install Flask Source: https://docs.kloudmate.com/guides/opentelemetry/python Installs the Flask framework using pip. ```bash pip install flask ``` -------------------------------- ### User Data Script for kmagent Installation Source: https://docs.kloudmate.com/kloudmate-agent/installation/aws-asg-deployment This bash script fetches the API key from SSM Parameter Store using IMDSv2, then downloads and installs the `kmagent`. It includes verification steps and logs errors if the agent fails to start. ```bash #!/bin/bash set -euo pipefail # ----------------------------------------------- # Fetch API key from SSM (IMDSv2 compatible) # ----------------------------------------------- REGION=$(curl -sf http://169.254.169.254/latest/meta-data/placement/region) TOKEN=$(curl -sf -X PUT "http://169.254.169.254/latest/api/token" \ -H "X-aws-ec2-metadata-token-ttl-seconds: 60") KM_API_KEY=$(aws ssm get-parameter \ --name "/kloudmate/api-key" \ --with-decryption \ --query "Parameter.Value" \ --output text \ --region "$REGION") # ----------------------------------------------- # Install kmagent # ----------------------------------------------- curl -fsSL https://raw.githubusercontent.com/kloudmate/km-agent/main/install.sh \ | bash -s -- \ --api-key "$KM_API_KEY" \ --colector-endpoint "https://otel.kloudmate.com" # ----------------------------------------------- # Verify # ----------------------------------------------- if systemctl is-active --quiet kmagent; then echo "[kloudmate] Agent installed and running" else echo "[kloudmate] ERROR: Agent failed to start" journalctl -u kmagent --no-pager -n 20 exit 1 fi ``` -------------------------------- ### Install Django Source: https://docs.kloudmate.com/guides/opentelemetry/python Installs the Django framework using pip. ```bash pip install django ``` -------------------------------- ### Install OpenTelemetry .NET Packages Source: https://docs.kloudmate.com/apm-and-tracing/manual-instrumentation/dotnet Install the core OpenTelemetry .NET packages and the OTLP exporter via NuGet. ```bash dotnet add package OpenTelemetry dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol dotnet add package OpenTelemetry.Extensions.Hosting ``` -------------------------------- ### Install Gems Source: https://docs.kloudmate.com/apm-and-tracing/manual-instrumentation/ruby Run bundle install to install the specified OpenTelemetry gems. ```bash bundle install ``` -------------------------------- ### Install OpenTelemetry Packages Source: https://docs.kloudmate.com/guides/opentelemetry/python Installs OpenTelemetry distribution, OTLP exporter, and bootstraps auto-instrumentation. ```bash pip install opentelemetry-distro opentelemetry-exporter-otlp opentelemetry-bootstrap -a install ``` -------------------------------- ### Install Rails Gem Source: https://docs.kloudmate.com/guides/opentelemetry/ruby Use this command to install the Rails gem if you don't have it already. ```txt gem install rails ``` -------------------------------- ### Install traceloop-sdk and openai Source: https://docs.kloudmate.com/llm-observability/instrument-with-openllmetry Install the necessary Python packages for OpenLLMetry instrumentation and OpenAI API interaction. ```bash pip install traceloop-sdk openai ``` -------------------------------- ### Install OpenTelemetry for Slim Framework Source: https://docs.kloudmate.com/guides/opentelemetry/php Installs OpenTelemetry SDK, OTLP exporter, Guzzle adapter, and auto-instrumentation for Slim. Disables php-http/discovery plugin to avoid conflicts. ```bash composer config allow-plugins.php-http/discovery false composer require \ open-telemetry/sdk \ open-telemetry/exporter-otlp \ php-http/guzzle7-adapter \ open-telemetry/opentelemetry-auto-slim ``` -------------------------------- ### Verify Monitoring Setup Source: https://docs.kloudmate.com/database-monitoring/direct-database-monitoring SQL queries to run as the monitoring user to verify that performance schema is enabled, consumers are active, and procedures exist. ```sql -- Check performance_schema is enabled SELECT @@performance_schema; -- Check consumers are active SELECT name, enabled FROM performance_schema.setup_consumers WHERE name LIKE 'events_statements_%' OR name = 'events_waits_current'; -- Check query digests are being collected SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest; -- Verify procedures exist SHOW PROCEDURE STATUS WHERE db = 'kloudmate'; -- Test explain CALL kloudmate.explain_statement('SELECT 1'); ``` -------------------------------- ### Run Django Migrations and Server Source: https://docs.kloudmate.com/guides/opentelemetry/python Applies database migrations and starts the Django development server. ```bash python manage.py migrate python manage.py runserver 127.0.0.1:8000 ``` -------------------------------- ### Install OpenTelemetry Trace API Packages Source: https://docs.kloudmate.com/guides/opentelemetry/go Installs the necessary OpenTelemetry packages for Go trace instrumentation. ```bash go get go.opentelemetry.io/otel \ go.opentelemetry.io/otel/trace ``` -------------------------------- ### Install gRPC Extension Source: https://docs.kloudmate.com/guides/opentelemetry/php Installs the gRPC extension, which may be required for certain OpenTelemetry configurations. ```bash pecl install grpc ``` -------------------------------- ### Install OpenTelemetry Packages Source: https://docs.kloudmate.com/apm-and-tracing/manual-instrumentation/python Install the necessary OpenTelemetry API, SDK, and exporter packages for Python using pip. ```bash pip install opentelemetry-api \ opentelemetry-sdk \ opentelemetry-exporter-otlp ``` -------------------------------- ### Run Slim Application Source: https://docs.kloudmate.com/guides/opentelemetry/php Start the Slim development server on localhost:8080. Verify by visiting http://localhost:8080/rolldice. ```bash php -S localhost:8080 ``` -------------------------------- ### Install boto3 for AWS Dynamic Inventory Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Install the necessary Python library to use the AWS dynamic inventory plugin. ```bash pip install boto3 ``` -------------------------------- ### Install Express and OpenTelemetry for JavaScript Source: https://docs.kloudmate.com/guides/opentelemetry/node-js Installs the Express framework and the Node.js auto-instrumentation package for JavaScript applications. ```bash npm install express npm install @opentelemetry/auto-instrumentations-node ``` -------------------------------- ### Install google-auth for GCP Dynamic Inventory Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Install the required Python library for the GCP dynamic inventory plugin. ```bash pip install google-auth ``` -------------------------------- ### Install Azure Libraries for Azure Dynamic Inventory Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Install the necessary Python libraries for the Azure dynamic inventory plugin. ```bash pip install azure-identity azure-mgmt-compute ``` -------------------------------- ### Install OpenTelemetry Packages for Web Source: https://docs.kloudmate.com/apm-and-tracing/manual-instrumentation/react Install the required OpenTelemetry packages for web applications using npm. ```bash npm install @opentelemetry/api \ @opentelemetry/core \ @opentelemetry/sdk-trace-web \ @opentelemetry/exporter-trace-otlp-http \ @opentelemetry/context-zone \ @opentelemetry/instrumentation \ @opentelemetry/instrumentation-document-load \ @opentelemetry/instrumentation-user-interaction ``` -------------------------------- ### Install KloudMate Agent on Linux VM Source: https://docs.kloudmate.com/azure-integration/azure-application-gateway-log-monitoring Use this command to install the KloudMate agent on a Linux virtual machine. Ensure you have curl installed. ```bash curl -s https://install.kloudmate.com | bash ``` -------------------------------- ### Install OpenTelemetry Packages Source: https://docs.kloudmate.com/guides/logs/send-winston-logs-with-opentelemetry-nodejs Installs the necessary npm packages for OpenTelemetry logging. ```shell npm i @opentelemetry/exporter-logs-otlp-http \ @opentelemetry/sdk-logs \ @opentelemetry/resources \ @opentelemetry/semantic-conventions ``` -------------------------------- ### Install OpenTelemetry Collector on RPM (arm64) Source: https://docs.kloudmate.com/opentelemetry/installing-the-opentelemetry-collector Installs the OpenTelemetry Collector contrib package for arm64 architecture on RPM-based systems. Ensure wget and systemctl are installed. ```bash sudo yum update sudo yum -y install wget systemctl wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.151.0/otelcol-contrib_0.151.0_linux_arm64.rpm sudo rpm -ivh otelcol-contrib_0.151.0_linux_arm64.rpm ``` -------------------------------- ### Install OpenTelemetry Collector on RPM (amd64) Source: https://docs.kloudmate.com/opentelemetry/installing-the-opentelemetry-collector Installs the OpenTelemetry Collector contrib package for amd64 architecture on RPM-based systems. Ensure wget and systemctl are installed. ```bash sudo yum update sudo yum -y install wget systemctl wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.151.0/otelcol-contrib_0.151.0_linux_amd64.rpm sudo rpm -ivh otelcol-contrib_0.151.0_linux_amd64.rpm ``` -------------------------------- ### Verify Docker Agent Installation Source: https://docs.kloudmate.com/kloudmate-agent/installation/docker-agent Run this command to check if the Docker agent is running correctly after installation. Ensure you have copied your account-specific command from KloudMate. ```bash docker ps -a | grep kloudmate-agent ``` -------------------------------- ### Install OpenTelemetry Laravel Packages Source: https://docs.kloudmate.com/apm-and-tracing/auto-instrumentation/php Installs the required OpenTelemetry packages for Laravel zero-code instrumentation using Composer. ```bash composer require open-telemetry/opentelemetry-auto-laravel composer require open-telemetry/sdk composer require open-telemetry/exporter-otlp composer require open-telemetry/api ``` -------------------------------- ### Install OpenTelemetry PHP Extension (Linux) Source: https://docs.kloudmate.com/guides/opentelemetry/php Installs the OpenTelemetry PHP extension on Ubuntu/Debian systems. Requires php-dev and php-pear. ```bash sudo apt-get install php-dev php-pear sudo pecl install opentelemetry ``` -------------------------------- ### Install Cert Manager using Helm Source: https://docs.kloudmate.com/kloudmate-agent/installation/kubernetes-agent Install Cert Manager if it's not already present in your cluster. Ensure you meet the version prerequisites. ```bash helm install \ cert-manager oci://quay.io/jetstack/charts/cert-manager \ --namespace cert-manager \ --create-namespace \ --set crds.enabled=true ``` -------------------------------- ### Install OpenTelemetry Collector on Debian (arm64) Source: https://docs.kloudmate.com/opentelemetry/installing-the-opentelemetry-collector Installs the OpenTelemetry Collector contrib package for arm64 architecture on Debian-based systems. Ensure wget and systemctl are installed. ```bash sudo apt-get update sudo apt-get -y install wget systemctl wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.151.0/otelcol-contrib_0.151.0_linux_arm64.deb sudo dpkg -i otelcol-contrib_0.151.0_linux_arm64.deb ``` -------------------------------- ### Install OpenTelemetry Collector on Debian (amd64) Source: https://docs.kloudmate.com/opentelemetry/installing-the-opentelemetry-collector Installs the OpenTelemetry Collector contrib package for amd64 architecture on Debian-based systems. Ensure wget and systemctl are installed. ```bash sudo apt-get update sudo apt-get -y install wget systemctl wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.151.0/otelcol-contrib_0.151.0_linux_amd64.deb sudo dpkg -i otelcol-contrib_0.151.0_linux_amd64.deb ``` -------------------------------- ### Run Flask Application Source: https://docs.kloudmate.com/guides/opentelemetry/python Starts the Flask development server on port 8080. ```bash flask run -p 8080 ``` -------------------------------- ### Install OpenTelemetry Packages for Node.js Source: https://docs.kloudmate.com/apm-and-tracing/manual-instrumentation/node-js Install the necessary OpenTelemetry packages for Node.js using npm. This includes the API, SDK, auto-instrumentations, and an OTLP HTTP trace exporter. ```bash npm install @opentelemetry/api \ @opentelemetry/sdk-node \ @opentelemetry/auto-instrumentations-node \ @opentelemetry/exporter-trace-otlp-http ``` -------------------------------- ### Install OpenTelemetry PHP Packages Source: https://docs.kloudmate.com/apm-and-tracing/manual-instrumentation/php Install the required OpenTelemetry packages for PHP using Composer. This includes the API, SDK, and OTLP exporter. ```bash composer require open-telemetry/api \ open-telemetry/sdk \ open-telemetry/exporter-otlp ``` -------------------------------- ### Navigate to Ansible Directory Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Change the current directory to the Ansible installation folder. ```bash cd ansible/ ``` -------------------------------- ### Install Express and OpenTelemetry for TypeScript Source: https://docs.kloudmate.com/guides/opentelemetry/node-js Installs necessary packages for TypeScript development, including Express, ts-node, and the Node.js auto-instrumentation package. ```bash npm install typescript ts-node @types/node express @types/express npm install @opentelemetry/auto-instrumentations-node ``` -------------------------------- ### Run the Instrumented .NET Application Source: https://docs.kloudmate.com/guides/opentelemetry/dotnet Execute the instrumented .NET application from the command line. This command starts the web server and makes it ready to receive requests. ```bash dotnet run ``` -------------------------------- ### Start and Monitor ML Classifier with Docker Compose Source: https://docs.kloudmate.com/database-monitoring/database-activity-monitoring-dam/ml-classifier-deployment-guide Commands to start the ML classifier in detached mode and to follow its logs for monitoring model loading and operational status. ```bash # Start the classifier in detached mode docker compose up -d # Check the logs to ensure models are loaded docker compose logs -f ``` -------------------------------- ### Install OpenTelemetry PHP Extension on macOS Source: https://docs.kloudmate.com/apm-and-tracing/auto-instrumentation/php Installs the OpenTelemetry PHP extension on macOS using pecl. ```bash pecl install opentelemetry ``` -------------------------------- ### Install OpenTelemetry PHP Extension on Linux Source: https://docs.kloudmate.com/apm-and-tracing/auto-instrumentation/php Installs the necessary OpenTelemetry PHP extension on Ubuntu/Debian systems using apt and pecl. ```bash sudo apt-get install php-dev php-pear pecl install opentelemetry ``` -------------------------------- ### Bash Script for Azure Integration and VM Setup Source: https://docs.kloudmate.com/azure-integration/auto-integration-with-azure-monitor This script automates the creation of an Azure AD application, service principal, and role assignment. It then deploys an Azure VM with a pre-configured OpenTelemetry Collector that sends metrics to KloudMate. ```bash #!/bin/bash # Check if App Name is provided if [ -z "$1" ] || [ -z "$2" ]; then echo "Usage: $0 " exit 1 fi APP_NAME="$1" ROLE="Reader" # Get Subscription & Tenant ID SUBSCRIPTION_ID="$2" TENANT_ID=$(az account show --query tenantId --output tsv) # Register an App in Azure AD echo "Creating Azure AD App: $APP_NAME..." APP_DETAILS=$(az ad app create --display-name "$APP_NAME" --query "{appId: appId, objectId: id}" --output json) CLIENT_ID=$(echo "$APP_DETAILS" | grep -o '"appId": "[^"']*' | cut -d'"' -f4) OBJECT_ID=$(echo "$APP_DETAILS" | grep -o '"id": "[^"']*' | cut -d'"' -f4) # Create a Client Secret echo "Creating Client Secret..." SECRET_DETAILS=$(az ad app credential reset --id "$CLIENT_ID" --query "{password: password}" --output json) CLIENT_SECRET=$(echo "$SECRET_DETAILS" | grep -o '"password": "[^"']*' | cut -d'"' -f4) # Create a Service Principal for the App echo "Creating Service Principal..." az ad sp create --id "$CLIENT_ID" --output none # Assign Reader Role to the App echo "Assigning Reader role to the App..." az role assignment create --assignee "$CLIENT_ID" --role "$ROLE" --scope "/subscriptions/$SUBSCRIPTION_ID" # Output the credentials echo "===========================" echo "App Registration Completed!" echo "App Name: $APP_NAME" echo "Client ID: $CLIENT_ID" echo "Tenant ID: $TENANT_ID" echo "Subscription ID: $SUBSCRIPTION_ID" echo "Client Secret (Save it securely!): $CLIENT_SECRET" echo "===========================" read -p "Enter Resource Group Name: " RESOURCE_GROUP read -p "Enter VM Admin Username: " ADMIN_USER read -s -p "Enter VM Admin Password: " ADMIN_PASSWORD read -p "Enter Kloudmate Auth-Key: " AUTH_KEY echo "" VM_NAME="otel-vm-demo" LOCATION="eastus" IMAGE="Ubuntu2204" SIZE="Standard_B2s" CLOUD_INIT_FILE="cloud-init.yaml" cat < "$CLOUD_INIT_FILE" #cloud-config package_update: true package_upgrade: true runcmd: - wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.120.0/otelcol-contrib_0.120.0_linux_amd64.deb - sudo dpkg -i otelcol-contrib_0.120.0_linux_amd64.deb - sudo systemctl enable otelcol-contrib - sudo systemctl start otelcol-contrib - echo "Updating OpenTelemetry config..." - sudo systemctl restart otelcol-contrib write_files: - path: /etc/otelcol-contrib/otelcol-contrib.conf content: | OTELCOL_OPTIONS="--config=/etc/otelcol-contrib/config.yaml" SUBSCRIPTION_ID=${SUBSCRIPTION_ID} TENANT_ID=${TENANT_ID} CLIENT_ID=${CLIENT_ID} CLIENT_SECRET=${CLIENT_SECRET} AUTH_KEY=${AUTH_KEY} - path: /etc/otelcol-contrib/config.yaml content: | extensions: health_check: pprof: endpoint: 0.0.0.0:1777 zpages: endpoint: 0.0.0.0:55679 receivers: otlp: protocols: grpc: endpoint: 0.0.0.0:4317 http: endpoint: 0.0.0.0:4318 azuremonitor: subscription_id: ${SUBSCRIPTION_ID} tenant_id: ${TENANT_ID} client_id: ${CLIENT_ID} client_secret: ${CLIENT_SECRET} cloud: AzureCloud collection_interval: 60s initial_delay: 1s processors: batch: send_batch_size: 10000 timeout: 30s exporters: debug: verbosity: detailed otlphttp: endpoint: "https://otel.kloudmate.com:4318" headers: Authorization: ${AUTH_KEY} # Replace with your actual KloudMate authentication key service: pipelines: metrics: receivers: [otlp, azuremonitor] processors: [batch] exporters: [debug, otlphttp] extensions: [health_check, pprof, zpages] EOF echo "Creating Azure VM: $VM_NAME..." az vm create --resource-group "$RESOURCE_GROUP" --name "$VM_NAME" --image "$IMAGE" --size "$SIZE" --admin-username "$ADMIN_USER" --admin-password "$ADMIN_PASSWORD" --custom-data "$CLOUD_INIT_FILE" ``` -------------------------------- ### Install Kloudmate Functions in All Databases Source: https://docs.kloudmate.com/database-monitoring/direct-database-monitoring This script iterates through all non-template PostgreSQL databases and applies the `kloudmate_functions.sql` script to each. Ensure `kloudmate_functions.sql` is in your current directory. ```bash for db in $(psql -t -c "SELECT datname FROM pg_database WHERE datistemplate = false"); do psql -d "$db" -f kloudmate_functions.sql done ``` -------------------------------- ### Install OTLP Exporter Package Source: https://docs.kloudmate.com/guides/opentelemetry/python Installs the OpenTelemetry OTLP exporter package using pip, enabling export of spans and metrics via OTLP. ```bash pip install opentelemetry-exporter-otlp ``` -------------------------------- ### Verify OpenTelemetry PHP Extension Installation Source: https://docs.kloudmate.com/apm-and-tracing/auto-instrumentation/php Checks if the opentelemetry extension is loaded and available in the PHP environment. ```bash php -m | grep opentelemetry ``` -------------------------------- ### Run Laravel Application Source: https://docs.kloudmate.com/guides/opentelemetry/php Start the Laravel development server on localhost:8000. Verify by visiting http://localhost:8000/rolldice. ```bash php artisan serve ``` -------------------------------- ### eBPF Configuration Example Source: https://docs.kloudmate.com/kloudmate-agent/management Configure the eBPF Receiver for deep kernel-level visibility. This snippet shows how to enable metrics collection for applications and network, discover services on specific ports, and enable Kubernetes attributes. ```yaml metrics: features: - application # HTTP, gRPC, SQL operation metrics (RED metrics) - application_span # Trace spans for transactions - network # L3/L4 Network flow metrics discovery: services: - name: all-services namespace: default open_ports: '80, 443, 8080, 8443, 5432, 3306, 6379, 9092, 27017' network: enable: true source: tc direction: both attributes: kubernetes: enable: true ``` -------------------------------- ### Run Instrumented App with OTLP Exporter Source: https://docs.kloudmate.com/guides/opentelemetry/ruby Starts the instrumented Rails server, configuring it to export traces to KloudMate's OTLP endpoint using HTTP/JSON protocol. Ensure you replace '' with your actual KloudMate private key. ```bash env OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.kloudmate.com:4318 OTEL_EXPORTER_OTLP_HEADERS="Authorization=" OTEL_EXPORTER_OTLP_PROTOCOL=http/json rails server -p 8080 ``` -------------------------------- ### Main Application Entry Point Source: https://docs.kloudmate.com/guides/opentelemetry/go Sets up the main application entry point, handling signals and running the application. ```go package main import ( "context" "log" "os" "os/signal" ) func main() { l := log.New(os.Stdout, "", 0) sigCh := make(chan os.Signal, 1) signal.Notify(sigCh, os.Interrupt) errCh := make(chan error) app := NewApp(os.Stdin, l) go func() { errCh <- app.Run(context.Background()) }() select { case <-sigCh: l.Println("\ngoodbye") return case err := <-errCh: if err != nil { l.Fatal(err) } } } ``` -------------------------------- ### Start Instance Refresh for ASG Source: https://docs.kloudmate.com/kloudmate-agent/installation/aws-asg-deployment Initiates a rolling replacement of instances in an Auto Scaling Group to deploy updated user data and the kmagent. Ensures a minimum healthy percentage during the refresh. ```bash aws autoscaling start-instance-refresh \ --auto-scaling-group-name your-asg-name \ --preferences '{ \ "MinHealthyPercentage": 90, \ "MaxHealthyPercentage": 110, \ "InstanceWarmup": 120 \ }' ``` -------------------------------- ### Run OpenTelemetry Collector with Docker Source: https://docs.kloudmate.com/guides/opentelemetry/php Starts an OpenTelemetry Collector using Docker, mounting a configuration file and exposing the OTLP gRPC receiver port. ```bash docker run -p 4317:4317 \ -v /tmp/otel-collector-config.yaml:/etc/otel-collector-config.yaml \ otel/opentelemetry-collector:latest \ --config=/etc/otel-collector-config.yaml ``` -------------------------------- ### Run OpenTelemetry Collector with Docker Source: https://docs.kloudmate.com/guides/opentelemetry/python Starts an OpenTelemetry Collector using Docker, mounting a custom configuration file and exposing the OTLP gRPC port. ```bash docker run -p 4317:4317 \ -v /tmp/otel-collector-config.yaml:/etc/otel-collector-config.yaml otel/opentelemetry-collector:latest \ -- config=/etc/otel-collector-config.yaml ``` -------------------------------- ### Install KloudMate Agent via SSM Run Command Source: https://docs.kloudmate.com/kloudmate-agent/installation/aws-asg-deployment Deploys the kmagent to instances within an Auto Scaling Group using AWS Systems Manager Run Command. This method installs the agent in-place without requiring instance replacement, ensuring zero downtime. ```bash aws ssm send-command \ --targets "Key=tag:aws:autoscaling:groupName,Values=your-asg-name" \ --document-name "AWS-RunShellScript" \ --parameters 'commands=[ \ "REGION=$(curl -sf http://169.254.169.254/latest/meta-data/placement/region)", \ "TOKEN=$(curl -sf -X PUT http://169.254.169.254/latest/api/token -H X-aws-ec2-metadata-token-ttl-seconds:60)", \ "KM_API_KEY=$(aws ssm get-parameter --name /kloudmate/api-key --with-decryption --query Parameter.Value --output text --region $REGION)", \ "curl -fsSL https://raw.githubusercontent.com/kloudmate/km-agent/main/install.sh | bash -s -- --api-key $KM_API_KEY --collector-endpoint https://otel.kloudmate.com" \ ]' \ --max-concurrency "10" \ --max-errors "5" \ --comment "Install kmagent on ASG fleet" ``` -------------------------------- ### Create Slim Project Directory Source: https://docs.kloudmate.com/guides/opentelemetry/php Use Composer to initialize a new Slim project with necessary dependencies. ```bash mkdir && cd composer init \ --no-interaction \ --stability beta \ --require slim/slim:"^4" \ --require slim/psr7:"^1" composer update ``` -------------------------------- ### Add OpenTelemetry Gems Source: https://docs.kloudmate.com/guides/opentelemetry/ruby Installs the 'opentelemetry-sdk' and 'opentelemetry-instrumentation-all' gems into your Ruby project using Bundler. These packages are essential for instrumenting your application. ```bash bundle add opentelemetry-sdk opentelemetry-instrumentation-all ``` -------------------------------- ### Install Kloudmate Agent with Tolerations on Tainted Nodes Source: https://docs.kloudmate.com/kloudmate-agent/installation/kubernetes-agent Use this Helm command to install the agent when your Kubernetes nodes have taints. Configure tolerations to ensure agent pods can be scheduled on these nodes. ```bash helm install kloudmate-release kloudmate/km-kube-agent --namespace km-agent --create-namespace \ --set API_KEY="" --set COLLECTOR_ENDPOINT="https://otel.kloudmate.com:4318" \ --set clusterName="" \ --set "monitoredNamespaces={MONITORED_NS}" \ --set tolerations[0].key="env" --set tolerations[0].operator="Equal" --set tolerations[0].value="uat" --set tolerations[0].effect="NoSchedule" \ --set tolerations[1].key="env" --set tolerations[1].operator="Equal" --set tolerations[1].value="sb-uat-node" --set tolerations[1].effect="NoSchedule" \ ``` -------------------------------- ### Run the Node.js Application (JavaScript) Source: https://docs.kloudmate.com/guides/opentelemetry/node-js Starts the Node.js application using the 'node' command. This is used after setting up the Express server and OpenTelemetry configurations for JavaScript. ```javascript $ node app.js Listening for requests on http://localhost:8080 ``` -------------------------------- ### Create Django Project and App Source: https://docs.kloudmate.com/guides/opentelemetry/python Sets up a new Django project and a 'hello' app, and configures settings. ```python django-admin startproject mysite . python manage.py startapp hello ``` ```python INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', ... 'hello', ] ``` ```python from django.http import HttpResponse def hello_world(request): return HttpResponse("Hello, World!") ``` ```python from django.urls import path from .views import hello_world urlpatterns = [ path('', hello_world), ] ``` ```python from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('', include('hello.urls')), ] ``` -------------------------------- ### Create and Activate Virtual Environment (Flask) Source: https://docs.kloudmate.com/guides/opentelemetry/python Sets up a Python virtual environment and activates it for a Flask project. ```bash python3 -m venv venv source ./venv/bin/activate ``` -------------------------------- ### Add OpenTelemetry NuGet Packages Source: https://docs.kloudmate.com/guides/opentelemetry/dotnet Install the necessary OpenTelemetry NuGet packages to enable automatic telemetry data generation for your ASP.NET Core application. ```txt dotnet add package OpenTelemetry.Extensions.Hosting dotnet add package OpenTelemetry.Instrumentation.AspNetCore dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol ``` -------------------------------- ### Example Histogram Bucket Metric Name Source: https://docs.kloudmate.com/visualize-data/explore/metrics-aggregations/histogram Illustrates the naming convention for histogram bucket time series in KloudMate. ```text http_server_duration_bucket ``` -------------------------------- ### Dynamic Annotation Value Example Source: https://docs.kloudmate.com/alarms/alarm-annotations Use Liquid templating to dynamically populate annotation values based on alarm data. Reference query results and dimensions using {{ }} syntax. ```liquid Host {{ dimensions.host_name }} is experiencing high CPU usage. Current value: {{ $A.value }}%. ``` -------------------------------- ### Initialize Go Module Source: https://docs.kloudmate.com/guides/opentelemetry/go Initializes the current directory as a Go module. ```bash go mod init fib ``` -------------------------------- ### Create MongoDB Cluster Monitor User Source: https://docs.kloudmate.com/database-monitoring/database-integrations/mongodb-monitoring Example command to create a MongoDB user with the clusterMonitor role, which is required for collecting metrics. Ensure to replace 'USER' and 'PASSWORD' with your desired credentials. ```text mongosh use admin db.createUser({ user: "USER", pwd: "PASSWORD", roles: [{ role: "clusterMonitor", db: "admin" }] }) exit ``` -------------------------------- ### Run the Node.js Application (TypeScript) Source: https://docs.kloudmate.com/guides/opentelemetry/node-js Starts the Node.js application using 'ts-node' for TypeScript files. This is used after setting up the Express server and OpenTelemetry configurations for TypeScript. ```typescript $ npx ts-node app.ts Listening for requests on http://localhost:8080 ``` -------------------------------- ### Exporter and Pipeline Configuration for Metrics and Logs Source: https://docs.kloudmate.com/database-monitoring/database-integrations/mysql-monitoring Configure the OTLP HTTP exporter for KloudMate backend and define pipelines for processing metrics and logs. This setup routes data to the KloudMate platform. ```yaml exporters: debug: verbosity: detailed otlphttp: endpoint: 'https://otel.kloudmate.com:4318' headers: Authorization: xxxxxxxx # Use the auth key service: pipelines: metrics: receivers: [mysql] processors: [batch, resourcedetection, resource] #use the correct resourcedetection exporters: [otlphttp] logs: receivers: [filelog/mysqlslowquery, filelog/mysqlerror] processors: [batch, resourcedetection, resource] #use the correct resourcedetection exporters: [otlphttp] extensions: [health_check, pprof, zpages, file_storage] ``` -------------------------------- ### Run the Application Source: https://docs.kloudmate.com/guides/opentelemetry/go Executes the Go application from the current directory. ```bash go run . ``` -------------------------------- ### GCP cloud-init Instance Template Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Create a GCP instance template with user-data specified from a cloud-init file. ```bash gcloud compute instance-templates create kmagent-template \ --metadata-from-file user-data=cloud-init/cloud-init.yaml \ --machine-type e2-medium \ --image-family ubuntu-2204-lts \ --image-project ubuntu-os-cloud ``` -------------------------------- ### Create a new .NET Web Application Source: https://docs.kloudmate.com/guides/opentelemetry/dotnet Use this command to create a new basic ASP.NET Core minimal API web application. ```txt dotnet new web ``` -------------------------------- ### Configure OTLP Endpoint and Headers for PHP Source: https://docs.kloudmate.com/apm-and-tracing/auto-instrumentation/php Set these environment variables to route auto-instrumented data to KloudMate. Replace YOUR_API_KEY with your actual KloudMate API key. ```bash export OTEL_EXPORTER_OTLP_ENDPOINT="https://otel.kloudmate.com:4318" export OTEL_EXPORTER_OTLP_HEADERS="Authorization=YOUR_API_KEY" export OTEL_SERVICE_NAME="your-php-service-name" ``` -------------------------------- ### Configure Exporter and Pipelines Source: https://docs.kloudmate.com/database-monitoring/database-integrations/postgresql-monitoring Sets up the KloudMate backend exporter using OTLP/HTTP and defines pipelines for metrics and logs. Ensure the correct resourcedetection processor is applied. ```yaml exporters: debug: verbosity: detailed otlphttp: endpoint: 'https://otel.kloudmate.com:4318' headers: Authorization: xxxxxxxx # Use the auth key service: pipelines: metrics: receivers: [postgresql] processors: [batch, resourcedetection, resource] # Apply the correct resourcedetection exporters: [otlphttp] logs: receivers: [pgsql_log] #use the correct filelog receiver as per your pg version processors: [batch, resourcedetection, resource] # Apply the correct resourcedetection exporters: [otlphttp] extensions: [health_check, pprof, zpages, file_storage] ``` -------------------------------- ### Configure .NET OTel Agent for KloudMate Source: https://docs.kloudmate.com/apm-and-tracing/auto-instrumentation/dotnet Set environment variables to route auto-instrumented .NET traces to KloudMate's OTLP endpoint. Replace YOUR_API_KEY with your actual KloudMate API key. ```bash export OTEL_EXPORTER_OTLP_ENDPOINT="https://otel.kloudmate.com:4318" export OTEL_EXPORTER_OTLP_HEADERS="Authorization=YOUR_API_KEY" export OTEL_SERVICE_NAME="your-dotnet-service-name" ``` -------------------------------- ### Alibaba Cloud cloud-init User Data Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Instructions for pasting cloud-init.yaml content into the ECS Console for Alibaba Cloud instances. ```text Paste cloud-init.yaml content into: ECS Console → Instance → Advanced Options → User Data ``` -------------------------------- ### Configure Node.js OTLP Endpoint and Headers Source: https://docs.kloudmate.com/apm-and-tracing/auto-instrumentation/node-js Set these environment variables to route auto-instrumented data to KloudMate. Replace YOUR_API_KEY with your actual KloudMate API key. ```bash export OTEL_EXPORTER_OTLP_ENDPOINT="https://otel.kloudmate.com:4318" export OTEL_EXPORTER_OTLP_HEADERS="Authorization=YOUR_API_KEY" export OTEL_SERVICE_NAME="your-nodejs-service-name" ``` -------------------------------- ### Initialize the RUM SDK Source: https://docs.kloudmate.com/rum/instrumentation-guide Initializes the KloudMate RUM SDK with the necessary configuration options. Ensure you provide the required `endpoint` and `rumAccessToken`. ```APIDOC ## init(options) ### Description Initializes the RUM SDK with the provided options. This method must be called before any other SDK methods. ### Method Signature `KloudMateRum.init(options)` ### Parameters #### options (object) - **applicationName** (string) - The application's name. - **endpoint** (string) - Required - KloudMate's collector endpoint (e.g., `https://otel.kloudmate.com:4318`). - **rumAccessToken** (string) - Required - KloudMate workspace's Public API key. - **deploymentEnvironment** (string) - Optional - The application's environment (e.g., dev, prod, staging). - **version** (string) - Optional - The application's version (e.g., 0.0.1, 1). - **globalAttributes** (object) - Optional - Key value pairs to be added to every span. - **sessionRecorder** (object) - Optional - Configure session recording. Accepts `{ enabled: boolean, options: RRWebRecordConfig }`. Defaults to disabled. - **ignoreUrls** (string[] | RegExp[]) - Optional - URLs to ignore during monitoring. ``` -------------------------------- ### Create Fibonacci Project Directory Source: https://docs.kloudmate.com/guides/opentelemetry/go Creates a new directory for the Fibonacci project and navigates into it. ```bash mkdir fib cd fib ``` -------------------------------- ### Build and Run the Application Source: https://docs.kloudmate.com/guides/opentelemetry/dotnet Use these commands to build the .NET application and then run it. After running, access 'localhost:8080/rolldice' in your web browser. ```txt dotnet build dotnet run ``` -------------------------------- ### Example Math Expression with Multiple Query Conditions Source: https://docs.kloudmate.com/alarms/expressions Use `ifNull` with reduced values to handle NoData from multiple queries in an alarm. This example checks if query A is greater than 50 or query B is greater than 90. ```text ifNull($A, 0) > 50 || ifNull($B, 0) > 90 ``` -------------------------------- ### Install KloudMate Agent using Helm Source: https://docs.kloudmate.com/kloudmate-agent/installation/kubernetes-agent Install the KloudMate Agent in your Kubernetes cluster using the generated Helm command. This command includes settings for API key, collector endpoint, cluster name, monitored namespaces, and feature enablement for logs and APM. ```bash helm repo add kloudmate https://charts.kloudmate.com helm repo update helm install kloudmate-release kloudmate/km-kube-agent \ --namespace km-agent --create-namespace \ --set API_KEY="" \ --set COLLECTOR_ENDPOINT="https://otel.kloudmate.dev:4318" \ --set clusterName="test" \ --set monitoredNamespaces="default, prod, dev" \ --set featuresEnabled.logs="true" \ --set featuresEnabled.apm="false" ``` -------------------------------- ### Configure Slim PHP App with OTLP Source: https://docs.kloudmate.com/guides/opentelemetry/php Set environment variables for a slim PHP application to send traces to KloudMate using OTLP. Ensure your KloudMate API token is used for authentication. ```bash export OTEL_PHP_AUTOLOAD_ENABLED=true export OTEL_SERVICE_NAME=my-php-app export OTEL_TRACES_EXPORTER=otlp export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.kloudmate.com:4318 export OTEL_EXPORTER_OTLP_HEADERS="Authorization=" export OTEL_PROPAGATORS=baggage,tracecontext ``` -------------------------------- ### Get Global Attributes Source: https://docs.kloudmate.com/rum/instrumentation-guide Retrieves the currently set global attributes from the RUM SDK. ```APIDOC ## getGlobalAttributes() ### Description Returns the global attributes that have been set on the SDK. ### Method Signature `KloudMateRum.getGlobalAttributes()` ### Returns - **object** - An object containing the current global attributes. ``` -------------------------------- ### Create OpenTelemetry Resource for Application Source: https://docs.kloudmate.com/guides/opentelemetry/go Defines and returns a resource that identifies the application, including its name, version, and environment, for telemetry data. ```go // newResource returns a resource describing this application. func newResource() *resource.Resource { r, _ := resource.Merge( resource.Default(), resource.NewWithAttributes( semconv.SchemaURL, semconv.ServiceName("fib"), semconv.ServiceVersion("v0.1.0"), attribute.String("environment", "demo"), ), ) return r } ``` -------------------------------- ### Edit Inventory File Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Open the production inventory file using Vim to add your hosts. ```bash vim inventories/production.ini ``` -------------------------------- ### DigitalOcean cloud-init User Data Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Create a DigitalOcean droplet with user data specified from a cloud-init file. ```bash doctl compute droplet create kmagent-node \ --image ubuntu-22-04-x64 \ --size s-1vcpu-1gb \ --user-data-file cloud-init/cloud-init.yaml ``` -------------------------------- ### Example Histogram Count Metric Name Source: https://docs.kloudmate.com/visualize-data/explore/metrics-aggregations/histogram Illustrates the naming convention for the count time series of a histogram metric in KloudMate. ```text http_server_duration_count ``` -------------------------------- ### Example Histogram Sum Metric Name Source: https://docs.kloudmate.com/visualize-data/explore/metrics-aggregations/histogram Illustrates the naming convention for the sum time series of a histogram metric in KloudMate. ```text http_server_duration_sum ``` -------------------------------- ### Uninstall Docker Agent Source: https://docs.kloudmate.com/kloudmate-agent/installation/docker-agent Execute this command to remove the KloudMate Agent installed via Docker. This will stop and remove the agent container. ```bash docker stop kloudmate-agent && docker rm kloudmate-agent ``` -------------------------------- ### Azure cloud-init Custom Data Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Create an Azure VM Scale Set using Ubuntu 22.04 and specifying custom data from a cloud-init file. ```bash az vmss create \ --name kmagent-vmss \ --resource-group myResourceGroup \ --image Ubuntu2204 \ --custom-data cloud-init/cloud-init.yaml ``` -------------------------------- ### Configure Exporter and Pipelines for KloudMate Backend Source: https://docs.kloudmate.com/azure-integration/manual-integration-of-azure-monitor Set up the OTLP HTTP exporter to send data to the KloudMate backend. Replace the placeholder with your actual KloudMate authentication key. This configures the metrics pipeline. ```yaml processors: batch: send_batch_size: 10000 timeout: 30s exporters: debug: verbosity: detailed otlphttp: endpoint: 'https://otel.kloudmate.com:4318' headers: Authorization: XXXXX # Replace with your actual KloudMate authentication key service: pipelines: metrics: receivers: [otlp, azuremonitor] processors: [batch] exporters: [debug, otlphttp] extensions: [health_check, pprof, zpages] ``` -------------------------------- ### Run Rails Server Source: https://docs.kloudmate.com/guides/opentelemetry/ruby Starts the Rails development server on port 8080. This command is used to run the application locally and test its functionality. ```txt rails server -p 8080 ``` -------------------------------- ### Configure OpenTelemetry Trace Provider Source: https://docs.kloudmate.com/guides/opentelemetry/go Sets up the OpenTelemetry Trace Provider, configuring it with a batch exporter and a resource, and registers it globally. ```go func main() { l := log.New(os.Stdout, "", 0) exp, err := KMTraceExporter() if err != nil { l.Fatal(err) } tp := trace.NewTracerProvider( trace.WithBatcher(exp), trace.WithResource(newResource()), ) defer func() { if err := tp.Shutdown(context.Background()); err != nil { l.Fatal(err) } }() otel.SetTracerProvider(tp) /*…*/ } ``` -------------------------------- ### AWS EC2 Dynamic Inventory Configuration Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Example configuration for the AWS EC2 dynamic inventory plugin, specifying regions, filters, and host key groups. ```yaml plugin: amazon.aws.aws_ec2 regions: - us-east-1 - us-west-2 - ap-south-1 filters: tag:Environment: production instance-state-name: running keyed_groups: - key: tags.Role prefix: role - key: placement.region prefix: region compose: ansible_host: private_ip_address ``` -------------------------------- ### Build and Run Spring Boot Application Source: https://docs.kloudmate.com/guides/opentelemetry/java Commands to build the Java application using Gradle and then run the generated JAR file. ```bash gradle assemble java -jar ./build/libs/java-simple.jar ``` -------------------------------- ### Apply Service and Deployment to Kubernetes Source: https://docs.kloudmate.com/database-monitoring/database-activity-monitoring-dam/ml-classifier-deployment-guide Apply the Kubernetes service and deployment manifests to deploy the ML classifier. ```bash kubectl apply -f service.yaml kubectl apply -f deployment.yaml ``` -------------------------------- ### Import Tracer into React App Source: https://docs.kloudmate.com/guides/opentelemetry/react Imports the configured OpenTelemetry tracer into the main entry point of the React application before the app component renders. This ensures tracing is active from the start. ```typescript import { createRoot } from "react-dom/client"; import "./styles/index.css"; import './tracer.ts' import App from "./App"; createRoot(document.getElementById("root")!).render( ); ``` -------------------------------- ### Define Prometheus Receiver in Agent Config Source: https://docs.kloudmate.com/infrastructure/integrations/prometheus-integration Add this configuration to your KloudMate Agent's config.yaml to enable the Prometheus receiver. You can adapt scrape jobs from your existing Prometheus setup. ```yaml receivers: prometheus: config: scrape_configs: - job_name: km-agent scrape_interval: 5s static_configs: - targets: ["0.0.0.0:8888"] - job_name: kubernetes-pods kubernetes_sd_configs: - role: pod relabel_configs: - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] regex: "true" action: keep metric_relabel_configs: - source_labels: [__name__] regex: "(request_duration_seconds.*|response_duration_seconds.*)" action: keep ``` -------------------------------- ### Deploy with GCP Dynamic Inventory Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Deploy the KloudMate agent using the GCP dynamic inventory plugin. ```bash ansible-playbook -i gcp_compute.yml deploy-kmagent.yml ``` -------------------------------- ### Configure OpenTelemetry SDK Environment Variables Source: https://docs.kloudmate.com/apm-and-tracing/manual-instrumentation/node-js Set environment variables to configure the OpenTelemetry SDK exporter to point to the KloudMate Agent's OTLP endpoint and define the service name. Ensure NODE_OPTIONS is set to register auto-instrumentations. ```bash export OTEL_EXPORTER_OTLP_ENDPOINT="http://KM_AGENT_HOST:4318" export OTEL_SERVICE_NAME="your-node-service" export NODE_OPTIONS="--require @opentelemetry/auto-instrumentations-node/register" ``` -------------------------------- ### Oracle Alert Log Monitoring Configuration Source: https://docs.kloudmate.com/database-monitoring/database-integrations/oracledb-monitoring Configure the collection of alert log messages, specifically filtering for 'deadlock' events. Set a tracking column and a starting timestamp for log collection. ```yaml - tracking_column: originating_timestamp tracking_start_value: 2024-01-01T00:00:00Z logs: - body_column: message_text attribute_columns: - time - originating_timestamp ``` -------------------------------- ### Configure Launch Settings Source: https://docs.kloudmate.com/guides/opentelemetry/dotnet Replace the content of launchSettings.json to configure how the application is launched, including the application URL and environment variables. ```txt { "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, "applicationUrl": "http://localhost:8080", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } } ``` -------------------------------- ### Minimal OpenTelemetry Configuration for PHP Source: https://docs.kloudmate.com/guides/opentelemetry/php Essential environment variables required for zero-code OpenTelemetry instrumentation with KloudMate, including service name and endpoint. ```ini OTEL_PHP_AUTOLOAD_ENABLED=true OTEL_SERVICE_NAME=my-laravel-app OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.kloudmate.com:4318 OTEL_EXPORTER_OTLP_HEADERS="Authorization=" ``` -------------------------------- ### Deploy with Azure Dynamic Inventory Source: https://docs.kloudmate.com/kloudmate-agent/installation/infrastructure-as-code-iaac-installation Deploy the KloudMate agent using the Azure dynamic inventory plugin. ```bash ansible-playbook -i azure_rm.yml deploy-kmagent.yml ``` -------------------------------- ### Audit User Login Activity Source: https://docs.kloudmate.com/logs/log-explorer/syntax-for-log-querying Find all user login attempts for users whose email does not start with 'test' and who were logging in from countries other than US or CA. This uses prefix and exclusion list filters. ```query /logs?filter=action=user_login&filter=user.email!^test&filter=geo.country!=US,CA ``` -------------------------------- ### Configure OTLP Endpoint and Service Name Source: https://docs.kloudmate.com/apm-and-tracing/manual-instrumentation Set environment variables to point your OpenTelemetry SDK exporter to the KloudMate Agent OTLP endpoint and define the service name. ```bash OTEL_EXPORTER_OTLP_ENDPOINT="http://KM_AGENT_HOST:4318" OTEL_SERVICE_NAME="your-service-name" ``` -------------------------------- ### Create Fluent Bit Dockerfile Source: https://docs.kloudmate.com/logs/amazon-ecs-container-logs-to-kloudmate Dockerfile to build a custom Fluent Bit image with configuration and parsers. ```dockerfile FROM fluent/fluent-bit:latest ADD logDestinations.conf /fluentbit-config.conf ADD parsers.conf /parsers.conf ``` -------------------------------- ### Oracle Database Connection Configuration Source: https://docs.kloudmate.com/database-monitoring/database-integrations/oracledb-monitoring Configure the connection details for an Oracle database, including host, port, service name, username, and password. This setup specifies file storage for data and a 30-second collection interval. ```yaml sqlquery/sessions: driver: oracle host: database: XEPDB1 port: 1521 collection_interval: 30s username: sys password: password storage: file_storage ```