Skip to content

Commit

Permalink
OpenSearch Spike (open-telemetry#1151)
Browse files Browse the repository at this point in the history
* add opensearch

* fix env

* fix yamllint

* fix lint

* fix errors in datasource

* remove stdout export
  • Loading branch information
austinlparker authored Oct 3, 2023
1 parent 3167734 commit c6e0561
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ services:
resources:
limits:
memory: 100M
environment:
- "GF_INSTALL_PLUGINS=grafana-opensearch-datasource"
volumes:
- ./src/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./src/grafana/provisioning/:/etc/grafana/provisioning/
Expand Down Expand Up @@ -692,6 +694,37 @@ services:
- "${PROMETHEUS_SERVICE_PORT}:${PROMETHEUS_SERVICE_PORT}"
logging: *logging

opensearch:
image: opensearchproject/opensearch:latest
container_name: opensearch
environment:
- cluster.name=demo-cluster
- node.name=demo-node
- bootstrap.memory_lock=true
- discovery.type=single-node
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
- "DISABLE_INSTALL_DEMO_CONFIG=true"
- "DISABLE_SECURITY_PLUGIN=true"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
ports:
- "9200:9200"
logging: *logging

dataprepper:
image: opensearchproject/data-prepper:latest
volumes:
- ./src/opensearch/pipelines.yaml:/usr/share/data-prepper/pipelines/pipelines.yaml
- ./src/opensearch/data-prepper-config.yaml:/usr/share/data-prepper/config/data-prepper-config.yaml
ports:
- "21892"
logging: *logging

# *****
# Tests
# *****
Expand Down
20 changes: 20 additions & 0 deletions src/grafana/provisioning/datasources/opensearch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

apiVersion: 1

datasources:
- name: OpenSearch
type: grafana-opensearch-datasource
url: http://opensearch:9200/
access: proxy
editable: true
isDefault: false
jsonData:
database: 'otel'
interval: Daily
timeField: 'time'
version: '2.10.0'
flavor: 'opensearch'
logMessageField: body
logLevelField: severitynumber
4 changes: 4 additions & 0 deletions src/opensearch/data-prepper-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

ssl: false
14 changes: 14 additions & 0 deletions src/opensearch/pipelines.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

demo-pipeline:
source:
otel_logs_source:
ssl: false
sink:
- opensearch:
hosts: ["http://opensearch:9200"]
insecure: true
username: admin
password: admin
index: otel
6 changes: 6 additions & 0 deletions src/otelcollector/otelcol-observability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ exporters:
endpoint: "jaeger:4317"
tls:
insecure: true
otlp/logs:
endpoint: "dataprepper:21892"
tls:
insecure: true
otlphttp/prometheus:
endpoint: "http://prometheus:9090/api/v1/otlp"
tls:
Expand All @@ -18,3 +22,5 @@ service:
exporters: [otlp, logging, spanmetrics]
metrics:
exporters: [otlphttp/prometheus, logging]
logs:
exporters: [otlp/logs, logging]

0 comments on commit c6e0561

Please sign in to comment.