forked from open-telemetry/opentelemetry-collector-contrib
-
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.
Add docker demo to opensearchexporter
Signed-off-by: acarbonetto <[email protected]>
- Loading branch information
1 parent
e056b0e
commit cc2bea1
Showing
3 changed files
with
122 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 |
---|---|---|
@@ -1 +1,8 @@ | ||
include ../../Makefile.Common | ||
|
||
local-run-example: | ||
cd ../../ && make docker-otelcontribcol | ||
cd demo && docker-compose up -d | ||
recreate-otel-collector: | ||
cd ../../ && GOOS=linux go build -o ./local/otelcontribcol ./cmd/otelcontribcol | ||
cd demo && docker-compose up --build otelcollector |
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,78 @@ | ||
version: "3" | ||
|
||
networks: | ||
otel-opensearch: | ||
|
||
services: | ||
opensearch-node: | ||
image: opensearchproject/opensearch:latest | ||
# image: opensearchproject/opensearch-dashboards:latest | ||
container_name: opensearch-node | ||
# container_name: opensearch-node-dashboard | ||
|
||
environment: | ||
- cluster.name=opensearch-cluster # Name the cluster | ||
- node.name=opensearch-node # Name the node that will run in this container | ||
- discovery.type=single-node # Nodes to look for when discovering the cluster | ||
- bootstrap.memory_lock=true # Disable JVM heap memory swapping | ||
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # Set min and max JVM heap sizes to at least 50% of system RAM | ||
- "DISABLE_SECURITY_PLUGIN=true" | ||
ulimits: | ||
memlock: | ||
soft: -1 # Set memlock to unlimited (no soft or hard limit) | ||
hard: -1 | ||
nofile: | ||
soft: 65536 # Maximum number of open files for the opensearch user - set to at least 65536 | ||
hard: 65536 | ||
ports: | ||
- "9200:9200" | ||
- "9600:9600" | ||
# - "5601:5601" | ||
networks: | ||
- otel-opensearch | ||
|
||
otelcontribcol: | ||
# Uncomment the next line to use a preexisting image | ||
image: otelcontribcol:latest | ||
container_name: otelcontribcol | ||
command: | ||
- "--config=/etc/otelcontribcol-config.yaml" | ||
- "--set=service.telemetry.logs.level=INFO" | ||
volumes: | ||
- ./otelcontribcol-config.yaml:/etc/otelcontribcol-config.yaml | ||
ports: | ||
- "4317:4317" # otlp receiver | ||
depends_on: | ||
- opensearch-node | ||
networks: | ||
- otel-opensearch | ||
|
||
demo-client: | ||
build: | ||
dockerfile: Dockerfile | ||
context: ../../../examples/demo/client | ||
container_name: demo-client | ||
restart: always | ||
environment: | ||
- OTEL_EXPORTER_OTLP_ENDPOINT=otelcontribcol:4317 | ||
- DEMO_SERVER_ENDPOINT=http://demo-server:7080/hello | ||
depends_on: | ||
- demo-server | ||
networks: | ||
- otel-opensearch | ||
|
||
demo-server: | ||
build: | ||
dockerfile: Dockerfile | ||
context: ../../../examples/demo/server | ||
container_name: demo-server | ||
restart: always | ||
environment: | ||
- OTEL_EXPORTER_OTLP_ENDPOINT=otelcontribcol:4317 | ||
ports: | ||
- "7080" | ||
depends_on: | ||
- otelcontribcol | ||
networks: | ||
- otel-opensearch | ||
|
37 changes: 37 additions & 0 deletions
37
exporter/opensearchexporter/demo/otelcontribcol-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,37 @@ | ||
processors: | ||
batch: | ||
send_batch_size: 100000 | ||
timeout: 5s | ||
memory_limiter: | ||
check_interval: 2s | ||
limit_mib: 1800 | ||
spike_limit_mib: 500 | ||
resource: | ||
attributes: | ||
- key: service.name | ||
value: "opensearch-exporter-demo" | ||
action: upsert | ||
exporters: | ||
opensearch: | ||
http: | ||
endpoint: http://opensearch-node:9200 | ||
|
||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
endpoint: 0.0.0.0:4317 | ||
|
||
extensions: | ||
health_check: | ||
pprof: | ||
zpages: | ||
memory_ballast: | ||
size_mib: 1000 | ||
|
||
service: | ||
pipelines: | ||
traces: | ||
processors: [ memory_limiter, resource, batch ] | ||
exporters: [ opensearch ] | ||
receivers: [ otlp ] |