-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d386d27
commit 0cf8254
Showing
4 changed files
with
91 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,8 @@ | ||
collector/components.go | ||
collector/go.mod | ||
collector/go.sum | ||
collector/main.go | ||
collector/main_others.go | ||
collector/main_windows.go | ||
collector/profiling-collector | ||
ocb |
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,28 @@ | ||
The collector code is just meant as an example. | ||
The receiver code needs to use the OTEL profiling API, once that is available. | ||
Technically, the receiver and collector code can both live in separate repositories. | ||
|
||
|
||
To get the `ocb` tool (OTEL collector builder, amend version): | ||
``` | ||
curl --proto '=https' --tlsv1.2 -fL -o ocb https://github.com/open-telemetry/opentelemetry-collector/releases/download/cmd%2Fbuilder%2Fv0.104.0/ocb_0.104.0_linux_amd64 | ||
chmod a+x ocb | ||
``` | ||
|
||
To build a static version of the collector with glibc | ||
``` | ||
./ocb --skip-strict-versioning --verbose --config builder-config.yaml | ||
``` | ||
|
||
To build a static version of the collector with muslc (on x86/amd64) | ||
``` | ||
CC=x86_64-linux-musl-gcc \ | ||
CGO_ENABLED=1 \ | ||
./ocb --skip-strict-versioning --verbose --config builder-config.yaml \ | ||
--ldflags="-linkmode external -extldflags=-static" | ||
``` | ||
|
||
Run the collector (start devfiler first) | ||
``` | ||
sudo collector/profiling-collector --config collector/config.yaml | ||
``` |
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,23 @@ | ||
dist: | ||
name: profiling-collector | ||
description: Profiling OTel Collector distribution | ||
output_path: ./collector | ||
otelcol_version: 0.104.0 | ||
|
||
exporters: | ||
- gomod: | ||
go.opentelemetry.io/collector/exporter/debugexporter v0.104.0 | ||
- gomod: | ||
go.opentelemetry.io/collector/exporter/otlpexporter v0.104.0 | ||
|
||
processors: | ||
- gomod: | ||
go.opentelemetry.io/collector/processor/batchprocessor v0.104.0 | ||
|
||
receivers: | ||
- gomod: | ||
go.opentelemetry.io/collector/receiver/otlpreceiver v0.104.0 | ||
- gomod: | ||
github.com/elastic/otel-profiling-agent v0.0.0-20240717140952-d386d2702214 | ||
import: github.com/elastic/otel-profiling-agent/otel/receiver | ||
name: profilingreceiver |
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,32 @@ | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
endpoint: 0.0.0.0:4317 | ||
otelreceiver: # this line represents the ID of your receiver | ||
project-id: 123 | ||
collection-agent: 127.0.0.1:11000 | ||
verbose: true | ||
disable-tls: true | ||
secret-token: abc123 | ||
|
||
processors: | ||
batch: | ||
|
||
exporters: | ||
debug: | ||
verbosity: detailed | ||
# otlp/jaeger: | ||
# endpoint: localhost:14317 | ||
# tls: | ||
# insecure: true | ||
|
||
service: | ||
pipelines: | ||
traces: | ||
receivers: [ otlp, otelreceiver ] | ||
processors: [ batch ] | ||
exporters: [ debug ] | ||
telemetry: | ||
logs: | ||
level: debug |