-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial commit: acc-m plugin wrapper for collector
- Loading branch information
Showing
5 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ | ||
{ | ||
"args": [ | ||
"" | ||
], | ||
"exec": "otel-metrics.rb", | ||
"skip_arguments": true | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
otelcol-contrib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
receivers: | ||
hostmetrics: | ||
collection_interval: 10s | ||
scrapers: | ||
cpu: | ||
memory: | ||
disk: | ||
filesystem: | ||
load: | ||
network: | ||
paging: | ||
processes: | ||
|
||
processors: | ||
batch: | ||
timeout: 5s | ||
resourcedetection: | ||
detectors: [env,system] | ||
|
||
exporters: | ||
carbon: | ||
endpoint: "localhost:2003" # The address of the Carbon/Graphite server | ||
timeout: 10s | ||
|
||
service: | ||
pipelines: | ||
metrics: | ||
receivers: [hostmetrics] | ||
processors: [batch, resourcedetection] | ||
exporters: [carbon] | ||
|
||
extensions: | ||
health_check: | ||
pprof: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# This is just a simple TCP server that proxies metrics output from the | ||
# carbonreceiver to stdout so it can be read by a sensu metrics plugin. | ||
|
||
require 'socket' | ||
require 'timeout' | ||
|
||
PORT = 2003 | ||
HOST = '0.0.0.0' | ||
TIMEOUT = 15 | ||
|
||
# TODO: run the collector binary / check if it's running. | ||
|
||
def start_server | ||
server = TCPServer.new(HOST, PORT) | ||
#puts "Server started on #{HOST}:#{PORT}" | ||
|
||
begin | ||
Timeout.timeout(TIMEOUT) do | ||
loop do | ||
client = server.accept | ||
Thread.new(client) do |client_connection| | ||
handle_client(client_connection) | ||
end | ||
end | ||
end | ||
rescue Timeout::Error | ||
#puts "Server timeout reached. Shutting down..." | ||
ensure | ||
server.close | ||
end | ||
end | ||
|
||
def handle_client(client) | ||
loop do | ||
line = client.gets | ||
break if line.nil? || line.chomp.empty? | ||
|
||
puts line.chomp | ||
client.puts line | ||
end | ||
|
||
client.close | ||
end | ||
|
||
start_server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Experimental OpenTelemetry ACC-M plugin | ||
|
||
Work in progress. |