From b798a2af15961cec65b7a776a087a9d6ee0cf5e0 Mon Sep 17 00:00:00 2001 From: nimishgj Date: Wed, 8 Oct 2025 22:01:40 +0530 Subject: [PATCH 1/3] restructure directory structure --- .../infra/Databases/_category_.json | 8 - docs/instrument/infra/Databases/mongodb.md | 116 ------- .../infra/aws/amazon-mq/_category_.json | 8 - .../infra/aws/{amazon-mq => }/amazonMQ.md | 4 +- docs/instrument/infra/aws/aws-vpc.md | 1 + docs/instrument/infra/aws/ecs-fargate.md | 328 ------------------ .../aws/{elasticache => }/elasticache.md | 4 +- .../infra/aws/elasticache/_category_.json | 9 - docs/instrument/infra/aws/{elb => }/elb.md | 4 +- docs/instrument/infra/aws/elb/_category_.json | 9 - .../infra/aws/{rds/postgres.md => rds.md} | 4 +- docs/instrument/infra/aws/rds/_category_.json | 8 - docs/instrument/infra/nginx.md | 264 -------------- 13 files changed, 9 insertions(+), 758 deletions(-) delete mode 100644 docs/instrument/infra/Databases/_category_.json delete mode 100644 docs/instrument/infra/Databases/mongodb.md delete mode 100644 docs/instrument/infra/aws/amazon-mq/_category_.json rename docs/instrument/infra/aws/{amazon-mq => }/amazonMQ.md (96%) delete mode 100644 docs/instrument/infra/aws/ecs-fargate.md rename docs/instrument/infra/aws/{elasticache => }/elasticache.md (96%) delete mode 100644 docs/instrument/infra/aws/elasticache/_category_.json rename docs/instrument/infra/aws/{elb => }/elb.md (98%) delete mode 100644 docs/instrument/infra/aws/elb/_category_.json rename docs/instrument/infra/aws/{rds/postgres.md => rds.md} (95%) delete mode 100644 docs/instrument/infra/aws/rds/_category_.json delete mode 100644 docs/instrument/infra/nginx.md diff --git a/docs/instrument/infra/Databases/_category_.json b/docs/instrument/infra/Databases/_category_.json deleted file mode 100644 index 89f3f60b..00000000 --- a/docs/instrument/infra/Databases/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Databases", - "position": 6, - "link": { - "type": "generated-index", - "description": "Instrumentation guides for database deployments." - } -} diff --git a/docs/instrument/infra/Databases/mongodb.md b/docs/instrument/infra/Databases/mongodb.md deleted file mode 100644 index 1dd14647..00000000 --- a/docs/instrument/infra/Databases/mongodb.md +++ /dev/null @@ -1,116 +0,0 @@ ---- -date: 2025-06-25 -id: collecting-mongodb-telemetry -title: MongoDB Metrics Collection with OTel Collector -description: Use Scout to monitor your MongoDB instance with ease -hide_table_of_contents: true ---- - -## Overview - -This guide explains how to set up MongoDB metrics collection using OTel -Collector and forward them to Base14 Scout backend. - -## Prerequisites - -1. MongoDB instance (standalone or replica set) -2. MongoDB user with `clusterMonitor` role -3. OpenTelemetry Collector installed -4. Base14 Scout access credentials - -## MongoDB User Setup - -Create a dedicated MongoDB user with the `clusterMonitor` role: - -```javascript -use admin -db.createUser({ - user:${MONGO_USER}, - pwd: ${MONGO_PASSWORD}, - roles: [ - { role: "clusterMonitor", db: "admin" }, - ] -}) -``` - -## Otel Collector Configuration - -```yaml -receivers: - mongodb: - hosts: - - endpoint: localhost:27017 # Update with your MongoDB host - username: ${MONGO_USER} - password: ${MONGO_PASSWORD} - collection_interval: 60s - timeout: 10s - - # TLS Configuration - tls: - insecure: true - insecure_skip_verify: true - - direct_connection: true # false for replica sets - - # Metrics Configuration (Some metrics are disabled by default) - mongodb.uptime: - enabled: true - -processors: - resource: - attributes: - - key: environment - value: ${ENVIRONMENT} - action: upsert - - key: service.name - value: ${SERVICE_NAME} - action: upsert - - batch: - timeout: 10s - send_batch_size: 1024 - -# Export to Base14 Scout -exporters: - otlphttp/b14: - endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT} - auth: - authenticator: oauth2client - tls: - insecure_skip_verify: true - - -extensions: - oauth2client: - client_id: ${OAUTH2_CLIENT_ID} - client_secret: ${OAUTH2_CLIENT_SECRET} - token_url: ${OAUTH2_TOKEN_URL} - endpoint_params: - audience: b14collector - tls: - insecure_skip_verify: true - -service: - extensions: [oauth2client] - pipelines: - metrics: - receivers: [mongodb] - processors: [batch, resource] - exporters: [otlphttp/b14] -``` - -## Verification - -1. Check collector logs for errors -2. Verify metrics in Base14 Scout dashboard -3. Test MongoDB connectivity: - - ```bash - mongosh "mongodb://${MONGO_USER}:${MONGO_PASSWORD}@localhost:27017/"\ - "admin?authSource=admin" --eval "db.serverStatus().ok" - ``` - -## References - -1. [Base14 OpenTelemetry Collector Setup]( - https://docs.base14.io/instrument/collector-setup/otel-collector-config) diff --git a/docs/instrument/infra/aws/amazon-mq/_category_.json b/docs/instrument/infra/aws/amazon-mq/_category_.json deleted file mode 100644 index 592bf5da..00000000 --- a/docs/instrument/infra/aws/amazon-mq/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Amazon MQ", - "position": 6, - "link": { - "type": "generated-index", - "description": "Collecting Telemetry from Amazon MQ using cloudwatch and prometheus cloudwatch exporter." - } -} diff --git a/docs/instrument/infra/aws/amazon-mq/amazonMQ.md b/docs/instrument/infra/aws/amazonMQ.md similarity index 96% rename from docs/instrument/infra/aws/amazon-mq/amazonMQ.md rename to docs/instrument/infra/aws/amazonMQ.md index 0188860b..aca8d2b9 100644 --- a/docs/instrument/infra/aws/amazon-mq/amazonMQ.md +++ b/docs/instrument/infra/aws/amazonMQ.md @@ -1,7 +1,7 @@ --- date: 2025-04-27 id: collecting-aws-amazon-mq-telemetry -title: Collecting AWS Amazon MQ Metrics +title: Amazon MQ description: Use Scout to monitor your AWS Amazon MQ with ease hide_table_of_contents: true --- @@ -24,7 +24,7 @@ For collecting Amazon MQ metrics, we recommend using **CloudWatch Metrics Stream ### Step 1: Set up CloudWatch Metrics Stream -Follow our comprehensive [CloudWatch Metrics Stream guide](../cloudwatch-metrics-stream.md) to set up the infrastructure. +Follow our comprehensive [CloudWatch Metrics Stream guide](cloudwatch-metrics-stream.md) to set up the infrastructure. ### Step 2: Configure Amazon MQ metrics filtering diff --git a/docs/instrument/infra/aws/aws-vpc.md b/docs/instrument/infra/aws/aws-vpc.md index ea3bab20..01c51aec 100644 --- a/docs/instrument/infra/aws/aws-vpc.md +++ b/docs/instrument/infra/aws/aws-vpc.md @@ -3,6 +3,7 @@ date: 2025-04-24 id: send-aws-vpc-flow-logs keywords: [AWS, VPC, Flow Logs, S3, Lambda, OTLP, base14 Scout] tags: [aws, vpc, s3, lambda, otlp] +title: VPC Flow Logs sidebar_position: 2 --- diff --git a/docs/instrument/infra/aws/ecs-fargate.md b/docs/instrument/infra/aws/ecs-fargate.md deleted file mode 100644 index c3cef213..00000000 --- a/docs/instrument/infra/aws/ecs-fargate.md +++ /dev/null @@ -1,328 +0,0 @@ ---- -date: 2025-04-09 -id: collecting-ecs-sidecar-infra -title: Collecting Telemetry from ECS using Sidecar Containers -description: Use Scout to monitor your ECS infrastructure with ease -hide_table_of_contents: true -keywords: [AWS, ECS, Cloudwatch, OTLP, Sidecar, base14 Scout] -tags: [aws, ecs, otlp] -sidebar_position: 1 ---- - -## Overview - -This guide will walk you through collecting rich telemetry data from your ECS -infrastructure using Scout by base14. We'll implement the elegant sidecar -pattern—a design where a companion container runs alongside your application -container to handle cross-cutting concerns like monitoring and observability. - -Think of the sidecar container as a faithful companion that quietly gathers -metrics, traces, and logs from your application, forwarding them to Scout for -powerful visualization and analysis. - -## Setting up Scout with ECS - -Let's transform your ECS environment into an observable system with the -following straightforward steps: - -- [Checking Prerequisites](#prerequisites) -- [Creating the Scout Collector Configuration](#step-1-create-scout-otelcollector-config) -- [Adding the Sidecar Container](#step-2-create-sidecar-collector-container) -- [Deploying Your Enhanced Task Definition](#step-3-deploy-the-task-definition) -- [Confirming Data Flow to Scout](#step-4-verify-data-in-scout) -- [Enhancing Your Applications with Trace Data](#send-traces-data-from-applications) - -### Prerequisites - -Before we begin, ensure you have: - -- An active ECS cluster with at least one task definition -- Your cluster can be running on **Fargate**, **EC2**, or **External** launch - types - -## Step 1: Create Scout OtelCollector Config - -First, we'll create a configuration file that tells the collector how to gather -and forward your telemetry data. - -### Creating your Scout configuration in AWS Parameter Store - -1. Navigate to AWS Parameter Store and create a new parameter named - `/ecs/scout/otelcol-sidecar.yaml` - -2. `otel-col-sidecar.yaml`: - - ```yaml showLineNumbers - extensions: - health_check: - - receivers: - awsecscontainermetrics: - collection_interval: 30s - otlp: - protocols: - grpc: - endpoint: 0.0.0.0:4317 - http: - endpoint: 0.0.0.0:4318 - fluentforward: - endpoint: 0.0.0.0:8006 - - processors: - batch: - timeout: 10s - filter: - metrics: - include: - match_type: strict - metric_names: - - ecs.task.memory.reserved - - ecs.task.memory.utilized - - ecs.task.cpu.reserved - - ecs.task.cpu.utilized - - ecs.task.network.rate.rx - - ecs.task.network.rate.tx - - ecs.task.storage.read_bytes - - ecs.task.storage.write_bytes - - container.duration - - exporters: - otlp: - endpoint: ":4317" - tls: - insecure: true - debug: - verbosity: detailed - - service: - extensions: [ health_check ] - pipelines: - traces: - receivers: [ otlp ] - processors: [ batch ] - exporters: [ otlp, debug ] - metrics: - receivers: [ otlp ] - processors: [ batch ] - exporters: [ otlp, debug ] - metrics/aws: - receivers: [ awsecscontainermetrics ] - processors: [ filter ] - exporters: [ otlp, debug ] - logs: - receivers: [ otlp, fluentforward ] - processors: [ batch ] - exporters: [ otlp, debug ] - ``` - -3. Personalize the configuration by replacing: - - - `` with your Scout Collector Endpoint - -4. Copy this tailored configuration into the parameter value field you created - in step 1 - -> **Pro tip:** Once your setup is stable, you can reduce noise by removing the -`logging` exporter from the configuration's pipeline sections. - -## Step 2: Create Sidecar Collector Container - -Now, we'll integrate the Scout collector as a sidecar to your existing -application. This collector will silently gather metrics and serve as a gateway -for all telemetry data. - -## Common Setup Steps - -### Enhance Your Task Definition - -Add the following container definition to your ECS task definition. This creates -the Scout collector sidecar that will work in harmony with your application: - -```json -{ - "name": "scout-collector", - "image": "otel/opentelemetry-collector-contrib:0.123.0", - "command": [ - "--config=env:SCOUT_CONFIG_CONTENT" - ], - "secrets": [ - { - "name": "SCOUT_CONFIG_CONTENT", - "valueFrom": "/ecs/scout/otelcol-sidecar.yaml" - } - ], - "memory": 1024, - "cpu": 512, - "essential": true, - "portMappings": [ - { - "protocol": "tcp", - "containerPort": 4317 - }, - { - "protocol": "tcp", - "containerPort": 4318 - } - ], - "healthCheck": { - "command": [ - "CMD-SHELL", - "wget -qO- http://localhost:13133/ || exit 1" - ], - "interval": 5, - "timeout": 6, - "retries": 5, - "startPeriod": 1 - }, - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": "/ecs/scout-otel-EC2-sidcar", - "awslogs-region": "", - "awslogs-stream-prefix": "ecs", - "awslogs-create-group": "True" - } - } -} -``` - -This sidecar definition contains all the necessary components for the Scout -collector to function effectively: the container image, configuration sourcing, -resource allocations, network endpoints, health monitoring, and log management. - -### Configure Task Execution Permissions - -Your ECS Task Execution Role needs permission to access the Scout configuration. -You have two elegant options: - -### Option 1: Attach AWS Managed Policies - -- Add `AmazonSSMReadOnlyAccess` for Parameter Store access -- Add `CloudWatchLogsFullAccess` for log management - -**Option 2: Create a Precise Inline Policy** -For those who prefer the principle of least privilege: - -```json -{ - "Version": "2012-10-17", - "Statement": [ - { - "Action": [ - "ssm:GetParameter" - ], - "Resource": [ - "arn:aws:ssm:::parameter/ecs/scout/otelcol-sidecar.yaml" - ], - "Effect": "Allow" - }, - { - "Effect": "Allow", - "Action": [ - "logs:CreateLogStream", - "logs:CreateLogGroup", - "logs:PutLogEvents", - "logs:DescribeLogStreams", - "logs:DescribeLogGroups" - ], - "Resource": "*" - } - ] -} -``` - -### Update Task Role Permissions - -Similarly, your ECS Task Role (distinct from the Execution Role) needs -appropriate permissions: - -1. Locate your task role in the IAM console -2. Either attach the managed policies mentioned above or create an inline policy - using the JSON template provided - -## Step 3: Deploy the Task Definition - -With your enhanced task definition ready: - -- For ECS services: Update your service to use the new task definition revision -- For standalone tasks: Launch a new task with the updated definition - -> **Note:** Once deployed, you can monitor the Scout collector's health through -> CloudWatch Logs under the group specified in your task definition. - -## Step 4: Verify Data in Scout - -To confirm your setup is working: - -1. Navigate to the Dashboard section in Scout -2. You should see your container metrics flowing in - -> Your ECS infrastructure metrics beautifully visualized in Scout - ---- - -## Send Traces Data from Applications - -Now, let's enhance your applications with distributed tracing capabilities. - -### Instrument Your Application - -Add OpenTelemetry instrumentation to your application to capture valuable trace -data: - -1. Follow - the [Scout instrumentation guide](https://docs.base14.io/category/observe) - to add the OpenTelemetry SDK to your application -2. Rebuild your application with these changes - -### Configure the OTLP Endpoint - -Tell your application where to send the trace data by adding environment -variables to your task definition: - -**For Bridge Network Mode:** - -```json -{ - "environment": [ - { - "name": "OTEL_EXPORTER_OTLP_ENDPOINT", - "value": "http://scout-collector:4317" - }, - { - "name": "OTEL_RESOURCE_ATTRIBUTES", - "value": "service.name=" - } - ], - "links": [ - "scout-collector" - ] -} -``` - -**For AWS VPC Network Mode:** - -```json -{ - "environment": [ - { - "name": "OTEL_EXPORTER_OTLP_ENDPOINT", - "value": "http://localhost:4317" - }, - { - "name": "OTEL_RESOURCE_ATTRIBUTES", - "value": "service.name=" - } - ] -} -``` - -After deploying these changes, generate some traffic to your application and -check the Services section in Scout to see your application's traces. - ---- - -With this setup complete, you've transformed your ECS environment into a fully -observable system. Scout now provides you with comprehensive insights into your -application's performance, behavior, and health—all without modifying your core -application logic. diff --git a/docs/instrument/infra/aws/elasticache/elasticache.md b/docs/instrument/infra/aws/elasticache.md similarity index 96% rename from docs/instrument/infra/aws/elasticache/elasticache.md rename to docs/instrument/infra/aws/elasticache.md index e4198aa5..472e6fd7 100644 --- a/docs/instrument/infra/aws/elasticache/elasticache.md +++ b/docs/instrument/infra/aws/elasticache.md @@ -1,7 +1,7 @@ --- date: 2025-04-28 id: collecting-aws-elasticache-telemetry -title: Collecting AWS ElastiCache Metrics +title: ElastiCache description: Use Scout to monitor your AWS ElastiCache instance with ease hide_table_of_contents: true --- @@ -24,7 +24,7 @@ For collecting ElastiCache metrics, we recommend using **CloudWatch Metrics Stre ### Step 1: Set up CloudWatch Metrics Stream -Follow our comprehensive [CloudWatch Metrics Stream guide](../cloudwatch-metrics-stream.md) to set up the infrastructure. +Follow our comprehensive [CloudWatch Metrics Stream guide](cloudwatch-metrics-stream.md) to set up the infrastructure. ### Step 2: Configure ElastiCache metrics filtering diff --git a/docs/instrument/infra/aws/elasticache/_category_.json b/docs/instrument/infra/aws/elasticache/_category_.json deleted file mode 100644 index 07670f16..00000000 --- a/docs/instrument/infra/aws/elasticache/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "Elasticache", - "position": 7, - "link": { - "type": "generated-index", - "description": "Collecting Telemetry from Amazon Elasticache using cloudwatch and prometheus cloudwatch exporter." - } -} - diff --git a/docs/instrument/infra/aws/elb/elb.md b/docs/instrument/infra/aws/elb.md similarity index 98% rename from docs/instrument/infra/aws/elb/elb.md rename to docs/instrument/infra/aws/elb.md index 52e39b2c..e29728aa 100644 --- a/docs/instrument/infra/aws/elb/elb.md +++ b/docs/instrument/infra/aws/elb.md @@ -1,7 +1,7 @@ --- date: 2025-04-26 id: collecting-aws-elb-telemetry -title: Collecting AWS Application ELB Metrics +title: Application ELB description: Use Scout to monitor your AWS ELB with ease hide_table_of_contents: true --- @@ -24,7 +24,7 @@ For collecting Application ELB metrics, we recommend using **CloudWatch Metrics ### Step 1: Set up CloudWatch Metrics Stream -Follow our comprehensive [CloudWatch Metrics Stream guide](../cloudwatch-metrics-stream.md) to set up the infrastructure. +Follow our comprehensive [CloudWatch Metrics Stream guide](cloudwatch-metrics-stream.md) to set up the infrastructure. ### Step 2: Configure Application ELB metrics filtering diff --git a/docs/instrument/infra/aws/elb/_category_.json b/docs/instrument/infra/aws/elb/_category_.json deleted file mode 100644 index 782c5b0f..00000000 --- a/docs/instrument/infra/aws/elb/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "Application ELB", - "position": 7, - "link": { - "type": "generated-index", - "description": "Collecting Telemetry from Application ELB using cloudwatch and prometheus cloudwatch exporter." - } -} - diff --git a/docs/instrument/infra/aws/rds/postgres.md b/docs/instrument/infra/aws/rds.md similarity index 95% rename from docs/instrument/infra/aws/rds/postgres.md rename to docs/instrument/infra/aws/rds.md index eac56b8d..0e787167 100644 --- a/docs/instrument/infra/aws/rds/postgres.md +++ b/docs/instrument/infra/aws/rds.md @@ -1,7 +1,7 @@ --- date: 2025-04-26 id: collecting-aws-rds-postgres-telemetry -title: Collecting AWS RDS PostgreSQL Metrics +title: RDS PostgreSQL description: Use Scout to monitor your AWS RDS postgres instance with ease hide_table_of_contents: true --- @@ -24,7 +24,7 @@ For collecting RDS metrics, we recommend using **CloudWatch Metrics Stream** ins ### Step 1: Set up CloudWatch Metrics Stream -Follow our comprehensive [CloudWatch Metrics Stream guide](../cloudwatch-metrics-stream.md) to set up the infrastructure. +Follow our comprehensive [CloudWatch Metrics Stream guide](cloudwatch-metrics-stream.md) to set up the infrastructure. ### Step 2: Configure RDS metrics filtering diff --git a/docs/instrument/infra/aws/rds/_category_.json b/docs/instrument/infra/aws/rds/_category_.json deleted file mode 100644 index 5636159c..00000000 --- a/docs/instrument/infra/aws/rds/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "RDS", - "position": 5, - "link": { - "type": "generated-index", - "description": "Collecting Telemetry from RDS using cloudwatch and prometheus cloudwatch exporter." - } -} diff --git a/docs/instrument/infra/nginx.md b/docs/instrument/infra/nginx.md deleted file mode 100644 index 2e50c6c3..00000000 --- a/docs/instrument/infra/nginx.md +++ /dev/null @@ -1,264 +0,0 @@ ---- -date: 2025-06-24 -id: nginx -keywords: [NGINX, OTLP, base14 Scout] -tags: [nginx] -title: NGINX -sidebar_position: 2 ---- - -## Overview - -This guide will walk you through collecting rich telemetry data from your nginx server -using `nginx-module-otel` module and we'll use prometheus nginx -exporter to collect metrics. - -## Prerequisties - -- NGINX Server installed. - -## Collecting metrics - -### Step 1: expose `stub_status` metrics from nginx - -In your Nginx config add the following config - -```conf -server { - listen 80; - server_name localhost; - - location /status { - stub_status; - allow 127.0.0.1; - deny all; - } -} -``` - -### Step 2: Run the nginx prometheus exporter using docker - -```shell -docker run --network=host nginx/nginx-prometheus-exporter:1.4.2 \ - --nginx.scrape-uri=http://localhost/status -``` - -### Step 3: Add the following receiver in your Scout collect - -```yaml - prometheus/nginx: - config: - scrape_configs: - - job_name: nginx - scrape_interval: 5s - metrics_path: /metrics - static_configs: - - targets: ['0.0.0.0:9113'] -``` - -> Note: Make sure you use in the pipelines as well. - -Great work, Now the metrics are scraped from the nginx - -## Collecting traces - -### Step 1: Add the nginx repositoring - -```mdx-code-block -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - - - -``` - -Install the prerequisites: - -```bash -sudo apt install curl gnupg2 ca-certificates lsb-release debian-archive-keyring -``` - -Import an official nginx signing key so apt could verify the packages -authenticity. Fetch the key: - -```bash -curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \ - | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null -``` - -Verify that the downloaded file contains the proper key: - -```bash -gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg -``` - -To set up the apt repository for stable nginx packages, run the following command: - -```bash -echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \ -http://nginx.org/packages/debian `lsb_release -cs` nginx" \ - | sudo tee /etc/apt/sources.list.d/nginx.list -``` - -```mdx-code-block - - -``` - -Install the prerequisites: - -```bash -sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -``` - -Import an official nginx signing key so apt could verify the packages -authenticity. Fetch the key: - -```bash -curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \ - | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null -``` - -Verify that the downloaded file contains the proper key: - -```bash -gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg -``` - -To set up the apt repository for stable nginx packages, run the following command: - -```bash -echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \ -http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \ - | sudo tee /etc/apt/sources.list.d/nginx.list -``` - -```mdx-code-block - - -``` - -Install the prerequisites: - -```bash -sudo apk add openssl curl ca-certificates -``` - -To set up the apk repository for stable nginx packages, run the following command: - -```bash -printf "%s%s%s%s\n" \ - "@nginx " \ - "http://nginx.org/packages/alpine/v" \ - `egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release` \ - "/main" \ - | sudo tee -a /etc/apk/repositories -``` - -```mdx-code-block - - -``` - -Install the prerequisites: - -```bash -sudo yum install yum-utils -``` - -To set up the yum repository for Amazon Linux 2, create the -file named `/etc/yum.repos.d/nginx.repo` with the following contents: - -```text -[nginx-stable] -name=nginx stable repo -baseurl=http://nginx.org/packages/amzn2/$releasever/$basearch/ -gpgcheck=1 -enabled=1 -gpgkey=https://nginx.org/keys/nginx_signing.key -module_hotfixes=true -priority=9 -``` - -To set up the yum repository for Amazon Linux 2023, create the -file named `/etc/yum.repos.d/nginx.repo` with the following contents: - -```text -[nginx-stable] -name=nginx stable repo -baseurl=http://nginx.org/packages/amzn/2023/$basearch/ -gpgcheck=1 -enabled=1 -gpgkey=https://nginx.org/keys/nginx_signing.key -module_hotfixes=true -priority=9 -``` - -```mdx-code-block - - -``` - -### Step 2: Installing Otel module for nginx - -```mdx-code-block - - -``` - -```bash -sudo yum install nginx-module-otel -``` - -```mdx-code-block - - -``` - -```bash -sudo apt install nginx-module-otel -``` - -```mdx-code-block - - -``` - -### Step 3: Configure nginx to send traces - -Add the following configs in your `nginx.conf` file: - -```conf -load_module modules/ngx_otel_module.so; - -http { - otel_exporter { - endpoint 0.0.0.0:4317; - } - otel_service_name nginx; - otel_resource_attr environment ; - otel_trace on; - otel_trace_context inject; -} -``` - -> Note: replace `otel_service_name` and `otel_resource_attr` with actual values. - -Now the traces will be sent to the otel collector. - -## Collecting logs - -### Step 1: Add the filelog receiver to collect the logs - -```yaml -receivers: - filelog: - include: - - /var/log/nginx/*.log - start_at: beginning -``` - -> Note: If you have configure log collection location to custom directory, -update the `include` block with the correct path. - -Great work. Now we have successfully implemented nginx with OpenTelemetry instrumentation From c4f9adb3db5ea4d79fcf667993d7118a866cecdb Mon Sep 17 00:00:00 2001 From: nimishgj Date: Wed, 8 Oct 2025 22:01:56 +0530 Subject: [PATCH 2/3] add components instrumentation docs --- docs/instrument/component/_category_.json | 8 + docs/instrument/component/mongodb.md | 101 ++++++++ docs/instrument/component/nginx.md | 270 ++++++++++++++++++++++ docs/instrument/component/postgres.md | 187 +++++++++++++++ docs/instrument/component/rabbitmq.md | 263 +++++++++++++++++++++ docs/instrument/component/redis.md | 160 +++++++++++++ 6 files changed, 989 insertions(+) create mode 100644 docs/instrument/component/_category_.json create mode 100644 docs/instrument/component/mongodb.md create mode 100644 docs/instrument/component/nginx.md create mode 100644 docs/instrument/component/postgres.md create mode 100644 docs/instrument/component/rabbitmq.md create mode 100644 docs/instrument/component/redis.md diff --git a/docs/instrument/component/_category_.json b/docs/instrument/component/_category_.json new file mode 100644 index 00000000..04eb93d1 --- /dev/null +++ b/docs/instrument/component/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "Component Instrumentation", + "position": 4, + "link": { + "type": "generated-index", + "description": "Next, lets instrument our components to collect it's telemetry." + } +} diff --git a/docs/instrument/component/mongodb.md b/docs/instrument/component/mongodb.md new file mode 100644 index 00000000..e728ebfd --- /dev/null +++ b/docs/instrument/component/mongodb.md @@ -0,0 +1,101 @@ +--- +date: 2025-06-25 +id: collecting-mongodb-telemetry +title: MongoDB +description: Use Scout to monitor your MongoDB instance with ease +--- + +## Overview + +This guide explains how to set up MongoDB metrics collection using OTel +Collector and forward them to Scout backend. + +## Prerequisites + +1. MongoDB instance (standalone or replica set) +2. MongoDB user with `clusterMonitor` role +3. OpenTelemetry Collector installed +4. Scout access credentials + +## MongoDB User Setup + +Create a dedicated MongoDB user with the `clusterMonitor` role: + +```javascript +use admin +db.createUser({ + user:${MONGO_USER}, + pwd: ${MONGO_PASSWORD}, + roles: [ + { role: "clusterMonitor", db: "admin" }, + ] +}) +``` + +## Otel Collector Configuration + +```yaml +receivers: + mongodb: + hosts: + - endpoint: localhost:27017 # Update with your MongoDB host + username: ${MONGO_USER} + password: ${MONGO_PASSWORD} + collection_interval: 60s + timeout: 10s + + # TLS Configuration + tls: + insecure: true + insecure_skip_verify: true + + direct_connection: true # false for replica sets + + # Metrics Configuration (Some metrics are disabled by default) + mongodb.uptime: + enabled: true + +processors: + resource: + attributes: + - key: environment + value: ${ENVIRONMENT} + action: upsert + - key: service.name + value: ${SERVICE_NAME} + action: upsert + + batch: + timeout: 10s + send_batch_size: 1024 + +# Export to Scout Collector +exporters: + otlphttp: + endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT} + tls: + insecure_skip_verify: true + +service: + pipelines: + metrics: + receivers: [mongodb] + processors: [batch, resource] + exporters: [otlphttp] +``` + +## Verification + +1. Check collector logs for errors +2. Verify metrics in Scout dashboard +3. Test MongoDB connectivity: + + ```bash + mongosh "mongodb://${MONGO_USER}:${MONGO_PASSWORD}@localhost:27017/"\ + "admin?authSource=admin" --eval "db.serverStatus().ok" + ``` + +## References + +1. [Base14 OpenTelemetry Collector Setup]( + https://docs.base14.io/instrument/collector-setup/otel-collector-config) diff --git a/docs/instrument/component/nginx.md b/docs/instrument/component/nginx.md new file mode 100644 index 00000000..eef71f39 --- /dev/null +++ b/docs/instrument/component/nginx.md @@ -0,0 +1,270 @@ +--- +date: 2025-06-24 +id: nginx +keywords: [NGINX, OTLP, base14 Scout] +tags: [nginx] +title: NGINX +sidebar_position: 2 +--- + +## Overview + +This guide will walk you through collecting rich telemetry data from your nginx server +using `nginx-module-otel` module and we'll use prometheus nginx +exporter to collect metrics. + +## Prerequisties + +- NGINX Server installed. + +## Collecting metrics + +### Step 1: expose `stub_status` metrics from nginx + +In your Nginx config add the following config + +```conf +server { + listen 80; + server_name localhost; + + location /status { + stub_status; + allow 127.0.0.1; + deny all; + } +} +``` + +### Step 2: Run the nginx prometheus exporter using docker + +```shell +docker run --network=host nginx/nginx-prometheus-exporter:1.4.2 \ + --nginx.scrape-uri=http://localhost/status +``` + +### Step 3: Add the following receiver in your Scout collect + +```yaml + prometheus/nginx: + config: + scrape_configs: + - job_name: nginx + scrape_interval: 5s + metrics_path: /metrics + static_configs: + - targets: ['0.0.0.0:9113'] +``` + +> Note: Make sure you use in the pipelines as well. + +Great work, Now the metrics are scraped from the nginx + +## Collecting traces + +### Step 1: Add the nginx repositoring + +```mdx-code-block +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + +``` + +Install the prerequisites: + +```bash +sudo apt install curl gnupg2 ca-certificates lsb-release debian-archive-keyring +``` + +Import an official nginx signing key so apt could verify the packages +authenticity. Fetch the key: + +```bash +curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \ + | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null +``` + +Verify that the downloaded file contains the proper key: + +```bash +gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg +``` + +To set up the apt repository for stable nginx packages, run the following command: + +```bash +echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \ +http://nginx.org/packages/debian `lsb_release -cs` nginx" \ + | sudo tee /etc/apt/sources.list.d/nginx.list +``` + +```mdx-code-block + + +``` + +Install the prerequisites: + +```bash +sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring +``` + +Import an official nginx signing key so apt could verify the packages +authenticity. Fetch the key: + +```bash +curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \ + | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null +``` + +Verify that the downloaded file contains the proper key: + +```bash +gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg +``` + +To set up the apt repository for stable nginx packages, run the following command: + +```bash +echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \ +http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \ + | sudo tee /etc/apt/sources.list.d/nginx.list +``` + +```mdx-code-block + + +``` + +Install the prerequisites: + +```bash +sudo apk add openssl curl ca-certificates +``` + +To set up the apk repository for stable nginx packages, run the following command: + +```bash +printf "%s%s%s%s\n" \ + "@nginx " \ + "http://nginx.org/packages/alpine/v" \ + `egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release` \ + "/main" \ + | sudo tee -a /etc/apk/repositories +``` + +```mdx-code-block + + +``` + +Install the prerequisites: + +```bash +sudo yum install yum-utils +``` + +To set up the yum repository for Amazon Linux 2, create the +file named `/etc/yum.repos.d/nginx.repo` with the following contents: + +```text +[nginx-stable] +name=nginx stable repo +baseurl=http://nginx.org/packages/amzn2/$releasever/$basearch/ +gpgcheck=1 +enabled=1 +gpgkey=https://nginx.org/keys/nginx_signing.key +module_hotfixes=true +priority=9 +``` + +To set up the yum repository for Amazon Linux 2023, create the +file named `/etc/yum.repos.d/nginx.repo` with the following contents: + +```text +[nginx-stable] +name=nginx stable repo +baseurl=http://nginx.org/packages/amzn/2023/$basearch/ +gpgcheck=1 +enabled=1 +gpgkey=https://nginx.org/keys/nginx_signing.key +module_hotfixes=true +priority=9 +``` + +```mdx-code-block + + +``` + +### Step 2: Installing Otel module for nginx + +```mdx-code-block + + +``` + +```bash +sudo yum install nginx-module-otel +``` + +```mdx-code-block + + +``` + +```bash +sudo apt install nginx-module-otel +``` + +```mdx-code-block + + +``` +:::warning + +Take a backup of your nginx config before installing the module. +It might be overwritten by the module installation. + +::: + +### Step 3: Configure nginx to send traces + +Add the following configs in your `nginx.conf` file: + +```conf +load_module modules/ngx_otel_module.so; + +http { + otel_exporter { + endpoint 0.0.0.0:4317; + } + otel_service_name nginx; + otel_resource_attr environment ; + otel_trace on; + otel_trace_context inject; +} +``` + +> Note: replace `otel_service_name` and `otel_resource_attr` with actual values. + +Now the traces will be sent to the otel collector. + +## Collecting logs + +### Step 1: Add the filelog receiver to collect the logs + +```yaml +receivers: + filelog: + include: + - /var/log/nginx/*.log + start_at: beginning +``` + +> Note: If you have configure log collection location to custom directory, +update the `include` block with the correct path. + +Great work. Now we have successfully implemented nginx with OpenTelemetry instrumentation diff --git a/docs/instrument/component/postgres.md b/docs/instrument/component/postgres.md new file mode 100644 index 00000000..c3a4542e --- /dev/null +++ b/docs/instrument/component/postgres.md @@ -0,0 +1,187 @@ +--- +date: 2025-10-08 +id: collecting-postgres-telemetry +title: Postgres +description: Use Scout to monitor your Postgres instance with ease +--- + +## Overview + +This guide explains how to set up PostgreSQL metrics collection using Scout +Collector and forward them to Scout backend. + +## Prerequisites + +1. PostgreSQL instance (standalone or cluster) +2. PostgreSQL superuser access for initial setup +3. Scout Collector installed + +## PostgreSQL User Setup + +Create a dedicated PostgreSQL user with monitoring privileges: + +```sql +-- Connect as superuser (postgres) +CREATE USER postgres_exporter WITH PASSWORD ''; +GRANT pg_monitor TO postgres_exporter; +``` + +The `pg_monitor` role provides access to all the statistics views and functions needed for monitoring without requiring superuser privileges. + +## PostgreSQL Configuration + +Ensure your PostgreSQL instance allows connections and has the required statistics enabled: + +```sql +-- Verify pg_stat_statements extension (optional but recommended) +CREATE EXTENSION IF NOT EXISTS pg_stat_statements; + +-- Check current connections +SELECT count(*) FROM pg_stat_activity; +``` + +Test connectivity with the monitoring user: +```bash +# Test PostgreSQL connectivity +psql -h -p -U postgres_exporter -d -c "SELECT version();" +``` + +## Scout Collector Configuration + +```yaml +receivers: + postgresql: + endpoint: ":" + collection_interval: 10s + username: "postgres_exporter" + password: "" + databases: [""] + tls: + insecure_skip_verify: true + + metrics: + postgresql.database.locks: + enabled: true + postgresql.deadlocks: + enabled: true + postgresql.sequential_scans: + enabled: true + postgresql.bgwriter.buffers.allocated: + enabled: true + postgresql.bgwriter.buffers.writes: + enabled: true + postgresql.bgwriter.checkpoint.count: + enabled: true + postgresql.bgwriter.duration: + enabled: true + postgresql.bgwriter.maxwritten: + enabled: true + postgresql.blocks_read: + enabled: true + postgresql.commits: + enabled: true + postgresql.database.count: + enabled: true + postgresql.db_size: + enabled: true + postgresql.backends: + enabled: true + postgresql.connection.max: + enabled: true + postgresql.rows: + enabled: true + postgresql.index.scans: + enabled: true + postgresql.index.size: + enabled: true + postgresql.operations: + enabled: true + postgresql.replication.data_delay: + enabled: true + postgresql.rollbacks: + enabled: true + postgresql.table.count: + enabled: true + postgresql.table.size: + enabled: true + postgresql.table.vacuum.count: + enabled: true + postgresql.temp_files: + enabled: true + postgresql.wal.age: + enabled: true + postgresql.wal.lag: + enabled: true + postgresql.wal.delay: + enabled: true + postgresql.tup_updated: + enabled: true + postgresql.tup_returned: + enabled: true + postgresql.tup_fetched: + enabled: true + postgresql.tup_inserted: + enabled: true + postgresql.tup_deleted: + enabled: true + postgresql.blks_hit: + enabled: true + postgresql.blks_read: + enabled: true + +processors: + resource: + attributes: + - key: environment + value: ${ENVIRONMENT} + action: upsert + - key: service.name + value: ${SERVICE_NAME} + action: upsert + + batch: + timeout: 10s + send_batch_size: 1024 + +# Export to Base14 Scout +exporters: + otlphttp: + endpoint: ${SCOUT_EXPORTER_OTLP_ENDPOINT} + tls: + insecure_skip_verify: true + +service: + pipelines: + metrics: + receivers: [postgresql] + processors: [batch, resource] + exporters: [otlphttp] +``` + +## Verification + +1. Check collector logs for errors: +2. Verify metrics in Scout dashboard +3. Verify PostgreSQL connectivity: + ```bash + # Test PostgreSQL connection + psql -h ${POSTGRES_HOST} -p -U postgres_exporter -d ${DATABASE_NAME} -c "SELECT version();" + ``` +4. Check PostgreSQL statistics: + ```sql + -- Check database statistics + SELECT * FROM pg_stat_database WHERE datname = ''; + + -- Check table statistics + SELECT * FROM pg_stat_user_tables LIMIT 5; + + -- Check index usage + SELECT * FROM pg_stat_user_indexes LIMIT 5; + ``` + +## References + +- [Base14 OpenTelemetry Collector Setup]( + https://docs.base14.io/instrument/collector-setup/otel-collector-config) +- [PostgreSQL Monitoring Views](https://www.postgresql.org/docs/current/monitoring-stats.html) +- [pg_monitor Role Documentation](https://www.postgresql.org/docs/current/default-roles.html) \ No newline at end of file diff --git a/docs/instrument/component/rabbitmq.md b/docs/instrument/component/rabbitmq.md new file mode 100644 index 00000000..030660e0 --- /dev/null +++ b/docs/instrument/component/rabbitmq.md @@ -0,0 +1,263 @@ +--- +date: 2025-10-08 +id: collecting-rabbitmq-telemetry +title: RabbitMQ +description: Use Scout to monitor your RabbitMQ instance with ease +--- + +## Overview + +This guide explains how to set up RabbitMQ metrics collection using Scout +Collector and forward them to Scout backend. + +## Prerequisites + +1. RabbitMQ instance (standalone or cluster) +2. RabbitMQ management plugin enabled +3. RabbitMQ user with monitoring privileges +4. Scout Collector installed + +## RabbitMQ Configuration + +Ensure the RabbitMQ management plugin is enabled: + +```bash +# Enable management plugin +rabbitmq-plugins enable rabbitmq_management + +# Verify management plugin is running +rabbitmq-plugins list | grep management +``` + +Create a dedicated monitoring user (optional but recommended): + +```bash +# Create monitoring user +rabbitmqctl add_user rabbitmq_monitor + +# Set permissions for monitoring +rabbitmqctl set_permissions -p / rabbitmq_monitor "" "" ".*" +rabbitmqctl set_user_tags rabbitmq_monitor monitoring + +# Test connectivity +curl -u rabbitmq_monitor: http://localhost:15672/api/overview +``` + +## Scout Collector Configuration + +```yaml +receivers: + rabbitmq: + endpoint: ${RABBITMQ_HOST} + username: ${RABBITMQ_USERNAME} + password: ${RABBITMQ_PASSWORD} + collection_interval: 10s + + metrics: + rabbitmq.node.disk_free: + enabled: true + rabbitmq.node.disk_free_limit: + enabled: true + rabbitmq.node.disk_free_alarm: + enabled: true + rabbitmq.node.disk_free_details.rate: + enabled: true + rabbitmq.node.mem_used: + enabled: true + rabbitmq.node.mem_limit: + enabled: true + rabbitmq.node.mem_alarm: + enabled: true + rabbitmq.node.mem_used_details.rate: + enabled: true + rabbitmq.node.fd_used: + enabled: true + rabbitmq.node.fd_total: + enabled: true + rabbitmq.node.fd_used_details.rate: + enabled: true + rabbitmq.node.sockets_used: + enabled: true + rabbitmq.node.sockets_total: + enabled: true + rabbitmq.node.sockets_used_details.rate: + enabled: true + rabbitmq.node.proc_used: + enabled: true + rabbitmq.node.proc_total: + enabled: true + rabbitmq.node.proc_used_details.rate: + enabled: true + rabbitmq.node.uptime: + enabled: true + rabbitmq.node.run_queue: + enabled: true + rabbitmq.node.processors: + enabled: true + rabbitmq.node.context_switches: + enabled: true + rabbitmq.node.context_switches_details.rate: + enabled: true + rabbitmq.node.gc_num: + enabled: true + rabbitmq.node.gc_num_details.rate: + enabled: true + rabbitmq.node.gc_bytes_reclaimed: + enabled: true + rabbitmq.node.gc_bytes_reclaimed_details.rate: + enabled: true + rabbitmq.node.io_read_count: + enabled: true + rabbitmq.node.io_read_bytes: + enabled: true + rabbitmq.node.io_read_avg_time: + enabled: true + rabbitmq.node.io_write_count: + enabled: true + rabbitmq.node.io_write_bytes: + enabled: true + rabbitmq.node.io_write_avg_time: + enabled: true + rabbitmq.node.io_sync_count: + enabled: true + rabbitmq.node.io_sync_avg_time: + enabled: true + rabbitmq.node.io_seek_count: + enabled: true + rabbitmq.node.io_seek_avg_time: + enabled: true + rabbitmq.node.io_reopen_count: + enabled: true + rabbitmq.node.mnesia_ram_tx_count: + enabled: true + rabbitmq.node.mnesia_disk_tx_count: + enabled: true + rabbitmq.node.msg_store_read_count: + enabled: true + rabbitmq.node.msg_store_write_count: + enabled: true + rabbitmq.node.queue_index_write_count: + enabled: true + rabbitmq.node.queue_index_read_count: + enabled: true + rabbitmq.node.connection_created: + enabled: true + rabbitmq.node.connection_closed: + enabled: true + rabbitmq.node.channel_created: + enabled: true + rabbitmq.node.channel_closed: + enabled: true + rabbitmq.node.queue_declared: + enabled: true + rabbitmq.node.queue_created: + enabled: true + rabbitmq.node.queue_deleted: + enabled: true + rabbitmq.node.io_read_count_details.rate: + enabled: true + rabbitmq.node.io_read_bytes_details.rate: + enabled: true + rabbitmq.node.io_read_avg_time_details.rate: + enabled: true + rabbitmq.node.io_write_count_details.rate: + enabled: true + rabbitmq.node.io_write_bytes_details.rate: + enabled: true + rabbitmq.node.io_write_avg_time_details.rate: + enabled: true + rabbitmq.node.io_sync_count_details.rate: + enabled: true + rabbitmq.node.io_sync_avg_time_details.rate: + enabled: true + rabbitmq.node.io_seek_count_details.rate: + enabled: true + rabbitmq.node.io_seek_avg_time_details.rate: + enabled: true + rabbitmq.node.io_reopen_count_details.rate: + enabled: true + rabbitmq.node.mnesia_ram_tx_count_details.rate: + enabled: true + rabbitmq.node.mnesia_disk_tx_count_details.rate: + enabled: true + rabbitmq.node.msg_store_read_count_details.rate: + enabled: true + rabbitmq.node.msg_store_write_count_details.rate: + enabled: true + rabbitmq.node.queue_index_write_count_details.rate: + enabled: true + rabbitmq.node.queue_index_read_count_details.rate: + enabled: true + rabbitmq.node.connection_created_details.rate: + enabled: true + rabbitmq.node.connection_closed_details.rate: + enabled: true + rabbitmq.node.channel_created_details.rate: + enabled: true + rabbitmq.node.channel_closed_details.rate: + enabled: true + rabbitmq.node.queue_declared_details.rate: + enabled: true + rabbitmq.node.queue_created_details.rate: + enabled: true + rabbitmq.node.queue_deleted_details.rate: + enabled: true + +processors: + resource: + attributes: + - key: environment + value: ${ENVIRONMENT} + action: upsert + - key: service.name + value: ${SERVICE_NAME} + action: upsert + + batch: + timeout: 10s + send_batch_size: 1024 + +# Export to Base14 Scout +exporters: + otlphttp: + endpoint: ${SCOUT_EXPORTER_OTLP_ENDPOINT} + tls: + insecure_skip_verify: true + +service: + pipelines: + metrics: + receivers: [rabbitmq] + processors: [batch, resource] + exporters: [otlphttp] +``` + +## Verification + +1. Check collector logs for errors +2. Verify metrics in Scout dashboard +3. Test RabbitMQ connectivity: + ```bash + # Test RabbitMQ management API + curl -u ${RABBITMQ_USERNAME}:${RABBITMQ_PASSWORD} \ + ${RABBITMQ_HOST}:15672/api/overview + ``` + +4. Check RabbitMQ node status: + ```bash + # Check node status + rabbitmqctl node_health_check + + # List queues + rabbitmqctl list_queues + + # Check cluster status (if clustered) + rabbitmqctl cluster_status + ``` + +## References + +- [Base14 OpenTelemetry Collector Setup]( + https://docs.base14.io/instrument/collector-setup/otel-collector-config) +- [RabbitMQ Management Plugin](https://www.rabbitmq.com/management.html) +- [RabbitMQ Monitoring Guide](https://www.rabbitmq.com/monitoring.html) \ No newline at end of file diff --git a/docs/instrument/component/redis.md b/docs/instrument/component/redis.md new file mode 100644 index 00000000..eeda0d62 --- /dev/null +++ b/docs/instrument/component/redis.md @@ -0,0 +1,160 @@ +--- +date: 2025-10-08 +id: collecting-redis-telemetry +title: Redis +description: Use Scout to monitor your Redis instance with ease +--- + +## Overview + +This guide explains how to set up Redis metrics collection using Scout +Collector and forward them to Scout backend. + +## Prerequisites + +1. Redis instance (standalone or cluster) +2. Redis connection credentials (if authentication is enabled) +3. Scout Collector installed + +## Redis Configuration + +Ensure your Redis instance is accessible and if authentication is enabled, +you have the appropriate credentials. + +For Redis with authentication: +```bash +# Test Redis connectivity +redis-cli -h -p -a ping +``` + +For Redis without authentication: +```bash +# Test Redis connectivity +redis-cli -h -p ping +``` + +## Scout Collector Configuration + +```yaml +receivers: + redis: + endpoint: ${REDIS_ENDPOINT} + collection_interval: 20s + # password: ${REDIS_PASSWORD} # Uncomment if authentication is enabled + + metrics: + redis.maxmemory: + enabled: true + redis.role: + enabled: true + redis.cmd.calls: + enabled: true + redis.cmd.usec: + enabled: true + redis.cmd.latency: + enabled: true + redis.uptime: + enabled: true + redis.cpu.time: + enabled: true + redis.clients.connected: + enabled: true + redis.clients.max_input_buffer: + enabled: true + redis.clients.max_output_buffer: + enabled: true + redis.clients.blocked: + enabled: true + redis.keys.expired: + enabled: true + redis.keys.evicted: + enabled: true + redis.connections.received: + enabled: true + redis.connections.rejected: + enabled: true + redis.memory.used: + enabled: true + redis.memory.peak: + enabled: true + redis.memory.rss: + enabled: true + redis.memory.lua: + enabled: true + redis.memory.fragmentation_ratio: + enabled: true + redis.rdb.changes_since_last_save: + enabled: true + redis.commands: + enabled: true + redis.commands.processed: + enabled: true + redis.net.input: + enabled: true + redis.net.output: + enabled: true + redis.keyspace.hits: + enabled: true + redis.keyspace.misses: + enabled: true + redis.latest_fork: + enabled: true + redis.slaves.connected: + enabled: true + redis.replication.backlog_first_byte_offset: + enabled: true + redis.replication.offset: + enabled: true + redis.db.keys: + enabled: true + redis.db.expires: + enabled: true + redis.db.avg_ttl: + enabled: true + redis.replication.replica_offset: + enabled: true + +processors: + resource: + attributes: + - key: environment + value: ${ENVIRONMENT} + action: upsert + - key: service.name + value: ${SERVICE_NAME} + action: upsert + + batch: + timeout: 10s + send_batch_size: 1024 + +# Export to Base14 Scout +exporters: + otlphttp: + endpoint: ${SCOUT_EXPORTER_OTLP_ENDPOINT} + tls: + insecure_skip_verify: true + +service: + pipelines: + metrics: + receivers: [redis] + processors: [batch, resource] + exporters: [otlphttp/b14] +``` + +## Verification + +1. Check collector logs for errors +2. Verify metrics in the Scout dashboard +3. Monitor Redis INFO command output: + ```bash + redis-cli -h ${REDIS_HOST} -p ${REDIS_PORT} info + ``` + + +## References + +- [Base14 OpenTelemetry Collector Setup]( + https://docs.base14.io/instrument/collector-setup/otel-collector-config) +- [Redis INFO Command Documentation](https://redis.io/commands/info/) \ No newline at end of file From b2a308f669f59b494b0646db6c73c52de30809c6 Mon Sep 17 00:00:00 2001 From: nimishgj Date: Wed, 8 Oct 2025 22:06:24 +0530 Subject: [PATCH 3/3] update link in introduction doc --- docs/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/introduction.md b/docs/introduction.md index d26cca9b..172acff5 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -65,7 +65,7 @@ Let's setup **Scout in less than 5 minutes**. We will follow the steps below: 5. **Instrument your infrastructure**: Use OpenTelemetry to collect telemetry data from your infrastructure components. This can include servers, databases, and other services. For example, for AWS ECS Fargate, please read - [AWS ECS Instrumentation](./instrument/infra/aws/ecs-fargate.md) to collect + [AWS ECS Instrumentation](./instrument/collector-setup/ecs-setup.md) to collect telemetry data from your Fargate services. 6. **Observe your telemetry data**: Access the Scout UI to view and analyze your telemetry data. You can explore logs, metrics, and traces to gain insights