Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opensearch] - Use opensearch exporter & remove dataprepper #1356

Merged
merged 11 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ IMAGE_NAME=ghcr.io/open-telemetry/demo

# Dependent images
COLLECTOR_CONTRIB_IMAGE=otel/opentelemetry-collector-contrib:0.93.0
DATAPREPPER_IMAGE=opensearchproject/data-prepper:latest
GRAFANA_IMAGE=grafana/grafana:10.3.1
JAEGERTRACING_IMAGE=jaegertracing/all-in-one:1.53
OPENSEARCH_IMAGE=opensearchproject/opensearch:latest
OPENSEARCH_IMAGE=opensearchproject/opensearch:2.11.1
POSTGRES_IMAGE=postgres:16.1
PROMETHEUS_IMAGE=quay.io/prometheus/prometheus:v2.49.1
REDIS_IMAGE=redis:7.2-alpine
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ the release.
([#1353](https://github.com/open-telemetry/opentelemetry-demo/pull/1353))
* Update dependent services - Collector, Grafana, Jaeger, Prometheus, etc.
([#1354](https://github.com/open-telemetry/opentelemetry-demo/pull/1354))
* [OpenSearch] Use native OpenSearch exporter from Collector
([#1356](https://github.com/open-telemetry/opentelemetry-demo/pull/1356))

## 1.7.2

Expand Down
25 changes: 12 additions & 13 deletions docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ services:
resources:
limits:
memory: 100M
restart: unless-stopped
environment:
- "GF_INSTALL_PLUGINS=grafana-opensearch-datasource"
volumes:
Expand Down Expand Up @@ -543,21 +544,28 @@ services:
resources:
limits:
memory: 300M
restart: unless-stopped
ports:
- "${PROMETHEUS_SERVICE_PORT}:${PROMETHEUS_SERVICE_PORT}"
logging: *logging

# OpenSearch
opensearch:
image: ${OPENSEARCH_IMAGE}
container_name: opensearch
deploy:
resources:
limits:
memory: 1G
restart: unless-stopped
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"
- OPENSEARCH_JAVA_OPTS=-Xms300m -Xmx300m
- DISABLE_INSTALL_DEMO_CONFIG=true
- DISABLE_SECURITY_PLUGIN=true
ulimits:
memlock:
soft: -1
Expand All @@ -566,14 +574,5 @@ services:
soft: 65536
hard: 65536
ports:
- "9200:9200"
logging: *logging

dataprepper:
image: ${DATAPREPPER_IMAGE}
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"
- "9200"
logging: *logging
25 changes: 12 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ services:
resources:
limits:
memory: 100M
restart: unless-stopped
environment:
- "GF_INSTALL_PLUGINS=grafana-opensearch-datasource"
volumes:
Expand Down Expand Up @@ -696,21 +697,28 @@ services:
resources:
limits:
memory: 300M
restart: unless-stopped
ports:
- "${PROMETHEUS_SERVICE_PORT}:${PROMETHEUS_SERVICE_PORT}"
logging: *logging

# OpenSearch
opensearch:
image: ${OPENSEARCH_IMAGE}
container_name: opensearch
deploy:
resources:
limits:
memory: 1G
restart: unless-stopped
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"
- OPENSEARCH_JAVA_OPTS=-Xms300m -Xmx300m
- DISABLE_INSTALL_DEMO_CONFIG=true
- DISABLE_SECURITY_PLUGIN=true
ulimits:
memlock:
soft: -1
Expand All @@ -719,16 +727,7 @@ services:
soft: 65536
hard: 65536
ports:
- "9200:9200"
logging: *logging

dataprepper:
image: ${DATAPREPPER_IMAGE}
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"
- "9200"
logging: *logging

# *****
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@
"type": "count"
}
],
"query": "search source=otel\n| where serviceName=\"${service}\"\n| stats count() by severityText",
"query": "search source=otel\n| where resource.service.name=\"${service}\"\n| stats count() by severity.text",
"queryType": "PPL",
"refId": "A",
"timeField": "time"
Expand Down Expand Up @@ -544,7 +544,7 @@
"type": "count"
}
],
"query": "search source=otel\n| where serviceName=\"${service}\"",
"query": "search source=otel\n| where resource.service.name=\"${service}\"",
"queryType": "PPL",
"refId": "A",
"timeField": "time"
Expand Down
11 changes: 5 additions & 6 deletions src/grafana/provisioning/datasources/opensearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ datasources:
editable: true
isDefault: false
jsonData:
database: 'otel'
interval: Daily
timeField: 'time'
version: '2.10.0'
flavor: 'opensearch'
database: otel
flavor: opensearch
logLevelField: severity
logMessageField: body
logLevelField: severitynumber
pplEnabled: true
timeField: "@timestamp"
4 changes: 0 additions & 4 deletions src/opensearch/data-prepper-config.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions src/opensearch/pipelines.yaml

This file was deleted.

13 changes: 7 additions & 6 deletions src/otelcollector/otelcol-config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0


receivers:
otlp:
protocols:
Expand All @@ -21,14 +20,16 @@ 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:
insecure: true
opensearch:
logs_index: otel
http:
endpoint: "http://opensearch:9200"
tls:
insecure: true

processors:
batch:
Expand Down Expand Up @@ -64,4 +65,4 @@ service:
logs:
receivers: [otlp]
processors: [batch]
exporters: [otlp/logs, debug]
exporters: [opensearch, debug]
Loading