Skip to content
Open
14 changes: 13 additions & 1 deletion linux/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,23 @@ receivers:
collection_interval: 30s
scrapers:
cpu:
metrics:
system.cpu.utilization:
enabled: true
system.cpu.logical.count:
enabled: true
disk:
filesystem:
metrics:
system.filesystem.utilization:
enabled: true
load:
memory:
metrics:
system.memory.utilization:
enabled: true
network:
paging:
paging:
processes:
# process: # a bug in the process scraper causes the collector to throw errors so disabling it for now
processors:
Expand Down Expand Up @@ -130,6 +141,7 @@ EOL
# Reload systemd and enable otel-collector service
systemctl daemon-reload
systemctl enable otel-collector
systemctl stop otel-collector
systemctl start otel-collector

echo "Otel-collector service started!"
8 changes: 7 additions & 1 deletion mac/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,18 @@ receivers:
# cpu: not implemented on mac (no cgo)
# disk: not implemented on mac (no cgo)
filesystem:
metrics:
system.filesystem.utilization:
enabled: true
load:
memory:
metrics:
system.memory.utilization:
enabled: true
network:
paging:
processes:
process:
process:
processors:
resourcedetection/system:
detectors: [ "system" ]
Expand Down
86 changes: 53 additions & 33 deletions windows/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ if (-not $URL -or -not $AUTH_KEY) {
# Detect the operating system and its architecture
$OS = "windows"
$ARCH = $ENV:PROCESSOR_ARCHITECTURE.ToLower()
$OTEL_VERSION = "0.90.1"
$OTEL_VERSION = "0.128.0"

# architecture check
$ARCH = if ($ARCH -eq "amd64") { "amd64" } elseif ($ARCH -eq "arm64") { "arm64" } elseif ($ARCH -eq "x86") { "386" } else { $ARCH }

# Construct the download URL for otel-collector based on OS and architecture
# $DOWNLOAD_URL = "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v${OTEL_VERSION}/otelcol-contrib_${OTEL_VERSION}_${OS}_${ARCH}.tar.gz"

$DOWNLOAD_URL = "https://zinc-public-data.s3.us-west-2.amazonaws.com/opentelemetry-collector-releases/otelcol-contrib_${OTEL_VERSION}_${OS}_${ARCH}.zip"
$DOWNLOAD_URL = "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v${OTEL_VERSION}/otelcol-contrib_${OTEL_VERSION}_${OS}_${ARCH}.tar.gz"

# Download otel-collector from the specified URL
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $DOWNLOAD_URL -OutFile "otelcol-contrib.zip"
Invoke-WebRequest -Uri $DOWNLOAD_URL -OutFile "otelcol-contrib.tar.gz"

# Ensure the target directory for extraction exists
$SERVICE_NAME="otel-collector"
Expand All @@ -36,7 +36,9 @@ if (-not (Test-Path $directoryPath -PathType Container)) {

# Extract the downloaded archive to the target directory
# tar -xzf "otelcol-contrib.tar.gz" -C $directoryPath
Expand-Archive "otelcol-contrib.zip" -DestinationPath $directoryPath -Force
# Expand-Archive "otelcol-contrib.zip" -DestinationPath $directoryPath -Force
tar -xvzf "otelcol-contrib.tar.gz" -C $directoryPath


# Generate a sample configuration file for otel-collector
$ConfigContent = @"
Expand All @@ -45,33 +47,49 @@ receivers:
collection_interval: 30s
scrapers:
cpu:
metrics:
system.cpu.utilization:
enabled: true
system.cpu.logical.count:
enabled: true
disk:
filesystem:
metrics:
system.filesystem.utilization:
enabled: true
load:
memory:
metrics:
system.memory.utilization:
enabled: true
network:
paging:
paging:
processes:
# process: # a bug in the process scraper causes the collector to throw errors so disabling it for now

process:
metrics:
process.cpu.utilization:
enabled: true
process.memory.utilization:
enabled: true

windowsperfcounters/memory:
collection_interval: 30s
metrics:
bytes.committed:
description: the number of bytes committed to memory
description: Number of bytes committed to memory
unit: By
gauge:
collection_interval: 30s
perfcounters:
- object: Memory
- object: "Memory"
counters:
- name: Committed Bytes
- name: "Committed Bytes"
metric: bytes.committed

windowsperfcounters/processor:
collection_interval: 1m
metrics:
processor.time:
description: active and idle time of the processor
description: Active vs. idle CPU time
unit: "%"
gauge:
perfcounters:
Expand All @@ -80,40 +98,36 @@ receivers:
counters:
- name: "% Processor Time"
metric: processor.time
attributes:
state: active
attributes: { state: active }
- object: "Processor"
instances: [1, 2]
instances: ["1", "2"]
counters:
- name: "% Idle Time"
metric: processor.time
attributes:
state: idle
windowseventlog/application:
channel: application
windowseventlog/security:
channel: security
windowseventlog/setup:
channel: setup
windowseventlog/system:
channel: system
attributes: { state: idle }

windowseventlog/application: { channel: application }
windowseventlog/security: { channel: security }
windowseventlog/setup: { channel: setup }
windowseventlog/system: { channel: system }

processors:
resourcedetection/system:
resourcedetection:
detectors: ["system"]
system:
hostname_sources: ["os"]

memory_limiter:
check_interval: 1s
limit_percentage: 75
spike_limit_percentage: 15

batch:
send_batch_size: 10000
timeout: 10s

extensions:
zpages: {}
memory_ballast:
size_mib: 512

exporters:
otlphttp/openobserve:
Expand All @@ -123,15 +137,21 @@ exporters:
Authorization: "Basic $AUTH_KEY"

service:
extensions: [zpages, memory_ballast]
extensions: [zpages]
pipelines:
metrics:
receivers: [windowsperfcounters/processor, windowsperfcounters/memory, hostmetrics]
processors: [resourcedetection/system, memory_limiter, batch]
receivers: [windowsperfcounters/processor,
windowsperfcounters/memory,
hostmetrics]
processors: [resourcedetection, memory_limiter, batch]
exporters: [otlphttp/openobserve]

logs:
receivers: [windowseventlog/application,windowseventlog/security,windowseventlog/setup,windowseventlog/system]
processors: [resourcedetection/system, memory_limiter, batch]
receivers: [windowseventlog/application,
windowseventlog/security,
windowseventlog/setup,
windowseventlog/system]
processors: [resourcedetection, memory_limiter, batch]
exporters: [otlphttp/openobserve]
"@

Expand Down
1 change: 1 addition & 0 deletions windows/uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if ($Service) {

# Remove otel-collector files
Remove-Item -Path "C:\otel-collector" -Recurse -Force -ErrorAction SilentlyContinue
sc.exe delete otel-collector

Write-Host "otel-collector uninstalled successfully!"