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 observability otel #3

Merged
merged 55 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
acf1cdc
Initial setup of Observability OTEL demo using Opensearch as store
YANG-DB Apr 26, 2023
c842150
Initial setup of Observability OTEL demo using Opensearch as store
YANG-DB Apr 26, 2023
b83ea99
Merge remote-tracking branch 'origin/opensearch-observability-otel' i…
YANG-DB Apr 26, 2023
9850688
Initial setup of Observability OTEL demo using Opensearch as store
YANG-DB May 1, 2023
0db3223
Merge branch 'main' into opensearch-observability-otel
YANG-DB May 2, 2023
bf41276
add curl to the basic docker O/S
YANG-DB May 3, 2023
4292136
Merge pull request #1 from open-telemetry/main
YANG-DB May 3, 2023
f0600be
add monitoring & opinionated assets for this demo
YANG-DB May 4, 2023
418d196
Merge remote-tracking branch 'origin/opensearch-observability-otel' i…
YANG-DB May 4, 2023
b0db9fc
export F/E & Load-Generator port services
YANG-DB May 8, 2023
9629fb7
Merge pull request #2 from open-telemetry/main
YANG-DB May 8, 2023
ba709f1
fix jaeger service name
YANG-DB May 9, 2023
daedfab
adding nginx as frontend proxy, fluent-bit.conf as log emitter
YANG-DB May 10, 2023
d58ed46
adding nginx & fluent-bit docs
YANG-DB May 10, 2023
a8e3f5d
Merge pull request #3 from open-telemetry/main
YANG-DB May 15, 2023
b6a018a
adding integrationbs docker-compose service for assets loading into o…
YANG-DB May 15, 2023
6031c17
Merge remote-tracking branch 'origin/opensearch-observability-otel' i…
YANG-DB May 15, 2023
92240ba
adding datasource for query prometheus
YANG-DB May 15, 2023
12d52cb
adding architecture.md including images
YANG-DB May 15, 2023
85fefce
add images and service links
YANG-DB May 16, 2023
73e2680
add jaeger-agent container name
YANG-DB May 16, 2023
f6067c6
add data-prepper support for traces ingestion & serviceMap creation
YANG-DB May 16, 2023
24d278c
fix auth issues for data-prepper
YANG-DB May 16, 2023
7410478
add documentation for different ingestion capabilities
YANG-DB May 16, 2023
d8a2abf
Merge pull request #4 from YANG-DB/otel-opensearch-data-prep
YANG-DB May 16, 2023
fe655cc
Initial setup of Observability OTEL demo using Opensearch as store
YANG-DB Apr 26, 2023
0be11cd
Initial setup of Observability OTEL demo using Opensearch as store
YANG-DB May 1, 2023
f54a011
add curl to the basic docker O/S
YANG-DB May 3, 2023
90c9a61
add monitoring & opinionated assets for this demo
YANG-DB May 4, 2023
379372a
[shippingservice] update rust version and dependencies (#865)
julianocosta89 May 3, 2023
6ae5c80
[load generator] Bump loagen dependencies (#869)
julianocosta89 May 3, 2023
a69595a
[grafana] fix demo dashboard to be compatible with spanmetrics connec…
fatsheep9146 May 3, 2023
1c28220
export F/E & Load-Generator port services
YANG-DB May 8, 2023
42537be
[kafka] remove KRaft mode support workarounds (#880)
styblope May 8, 2023
8bd25ad
enabling batch span processor metrics for quoteservice (#878)
brettmc May 8, 2023
2cc7484
Generate random errors in cartservice (#824)
alanwest May 8, 2023
54e3b6f
fix jaeger service name
YANG-DB May 9, 2023
daf0d08
adding nginx as frontend proxy, fluent-bit.conf as log emitter
YANG-DB May 10, 2023
88e0171
adding nginx & fluent-bit docs
YANG-DB May 10, 2023
d292741
adding integrationbs docker-compose service for assets loading into o…
YANG-DB May 15, 2023
6f55bd8
[currencyservice] Fix OTel C++ build and update OTel version (#886)
julianocosta89 May 12, 2023
193552f
adding datasource for query prometheus
YANG-DB May 15, 2023
febdfe1
adding architecture.md including images
YANG-DB May 15, 2023
904ed80
add images and service links
YANG-DB May 16, 2023
9cf4326
add jaeger-agent container name
YANG-DB May 16, 2023
c14aa11
add data-prepper support for traces ingestion & serviceMap creation
YANG-DB May 16, 2023
a55d74f
fix auth issues for data-prepper
YANG-DB May 16, 2023
6032e3e
add documentation for different ingestion capabilities
YANG-DB May 16, 2023
5954bdf
Merge remote-tracking branch 'origin/opensearch-observability-otel' i…
YANG-DB May 18, 2023
4d1d72e
add assets manager flast app for loading the integration assets
YANG-DB May 18, 2023
91f7a0e
remove experimental assets mgr app
YANG-DB May 18, 2023
78b38e6
Opensearch otel demo observability tutorial (#5)
YANG-DB May 23, 2023
fe8a551
Merge pull request #2 from open-telemetry/main
YANG-DB May 26, 2023
b422bc7
Update local-config.md
YANG-DB May 26, 2023
4431d7b
Update README.md
YANG-DB May 26, 2023
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
16 changes: 15 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ EMAIL_SERVICE_PORT=6060
EMAIL_SERVICE_ADDR=http://emailservice:${EMAIL_SERVICE_PORT}

# Feature Flag Service
FEATURE_FLAG_SERVICE_PORT=8081
FEATURE_FLAG_SERVICE_PORT=8881
FEATURE_FLAG_SERVICE_ADDR=featureflagservice:${FEATURE_FLAG_SERVICE_PORT}
FEATURE_FLAG_SERVICE_HOST=feature-flag-service
FEATURE_FLAG_GRPC_SERVICE_PORT=50053
Expand All @@ -53,6 +53,10 @@ FEATURE_FLAG_GRPC_SERVICE_ADDR=featureflagservice:${FEATURE_FLAG_GRPC_SERVICE_PO
FRONTEND_PORT=8080
FRONTEND_ADDR=frontend:${FRONTEND_PORT}

# Nginx Proxy
NGINX_PORT=90
NGINX_ADDR=nginx:${FRONTEND_PORT}

# Frontend Proxy (Envoy)
FRONTEND_HOST=frontend
ENVOY_PORT=8080
Expand Down Expand Up @@ -111,3 +115,13 @@ JAEGER_SERVICE_HOST=jaeger
PROMETHEUS_SERVICE_PORT=9090
PROMETHEUS_SERVICE_HOST=prometheus
PROMETHEUS_ADDR=${PROMETHEUS_SERVICE_HOST}:${PROMETHEUS_SERVICE_PORT}

# OpenSearch Node1
OPENSEARCH1_PORT=9200
OPENSEARCH1_HOST=opensearch-node1
OPENSEARCH1_ADDR=${OPENSEARCH1_HOST}:${OPENSEARCH1_PORT}

# OpenSearch Dashboard
OPENSEARCH_DASHBOARD_PORT=5601
OPENSEARCH_DASHBOARD_HOST=opensearch-dashboards
OPENSEARCH_DASHBOARD_ADDR=${OPENSEARCH_DASHBOARD_HOST}:${OPENSEARCH_DASHBOARD_PORT}
57 changes: 57 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# <img src="https://opentelemetry.io/img/logos/opentelemetry-logo-nav.png" alt="OTel logo" width="32"> + <img src="https://avatars.githubusercontent.com/u/80134844?s=240&v=4" alt="OTel logo" width="35"> OpenTelemetry Demo with OpenSearch

The following guide describes how to setup the OpenTelemetry demo with OpenSearch Observability using [Docker compose](#docker-compose) or [Kubernetes](#kubernetes).

## Docker compose

### Prerequisites

- Docker
- Docker Compose v2.0.0+
- 4 GB of RAM for the application

### Running this demo

```bash
git clone https://github.com/opensearch/opentelemetry-demo.git
cd opentelemetry-demo
docker compose up -d
```

### Services

Once the images are built and containers are started you can access:

- Webstore-Proxy (Via Nginx Proxy): http://localhost:90/
- Webstore: http://localhost:8080/
- Dashboards: http://localhost:5061/
- Feature Flags UI: http://localhost:8080/feature/
- Load Generator UI: http://localhost:8080/loadgen/

OpenSearch has [documented](https://opensearch.org/docs/latest/observing-your-data/trace/trace-analytics-jaeger/#setting-up-opensearch-to-use-jaeger-data) the usage of the Observability plugin with jaeger as a trace signal source.

The next instructions are similar and use the same docker compose file.
1. Start the demo with the following command from the repository's root directory:
```
docker compose up -d
```
**Note:** The docker compose `--no-build` flag is used to fetch released docker images from [ghcr](http://ghcr.io/open-telemetry/demo) instead of building from source.
Removing the `--no-build` command line option will rebuild all images from source. It may take more than 20 minutes to build if the flag is omitted.

### Explore and analyze the data With OpenSearch Observability
Review revised OpenSearch [Observability Architecture](architecture.md)

### Start learning OpenSearch Observability using our tutorial
[Getting started Tutorial](../tutorial/README.md)

#### Service map
![Service map](https://docs.aws.amazon.com/images/opensearch-service/latest/developerguide/images/ta-dashboards-services.png)

#### Traces
![Traces](https://opensearch.org/docs/2.6/images/ta-trace.png)

#### Correlation
![Correlation](https://opensearch.org/docs/latest/images/observability-trace.png)

#### Logs
![Logs](https://opensearch.org/docs/latest/images/trace_log_correlation.gif)
104 changes: 104 additions & 0 deletions .github/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Opensearch OTEL Demo Architecture
This document will review the OpenSearch architecture for the [OTEL demo](https://opentelemetry.io/docs/demo/) and will review how to use the new Observability capabilities
implemented into OpenSearch.
---
This diagram provides an overview of the system components, showcasing the configuration derived from the OpenTelemetry Collector (otelcol) configuration file utilized by the OpenTelemetry demo application.

Additionally, it highlights the observability data (traces and metrics) flow within the system.

![](img/otelcol-data-flow-overview.png)

---
[OTEL DEMO](https://opentelemetry.io/docs/demo/architecture/) Describes the list of services that are composing the Astronomy Shop.

They are combined of:
- [Accounting](https://opentelemetry.io/docs/demo/services/accounting/)
- [Ad](https://opentelemetry.io/docs/demo/services/ad/)
- [Cart](https://opentelemetry.io/docs/demo/services/cart/)
- [Checkout](https://opentelemetry.io/docs/demo/services/checkout/)
- [Currency](https://opentelemetry.io/docs/demo/services/currency/)
- [Email](https://opentelemetry.io/docs/demo/services/email/)
- [Feature Flag](https://opentelemetry.io/docs/demo/services/feature-flag/)
- [Fraud Detection](https://opentelemetry.io/docs/demo/services/fraud-detection/)
- [Frontend](https://opentelemetry.io/docs/demo/services/frontend/)
- [Kafka](https://opentelemetry.io/docs/demo/services/kafka/)
- [Payment](https://opentelemetry.io/docs/demo/services/payment/)
- [Product Catalog](https://opentelemetry.io/docs/demo/services/product-catalog/)
- [Quote](https://opentelemetry.io/docs/demo/services/quote/)
- [Recommendation](https://opentelemetry.io/docs/demo/services/recommendation/)
- [Shipping](https://opentelemetry.io/docs/demo/services/shipping/)
- [Fluent-Bit](../src/fluent-bit/README.md) *(nginx's otel log exported)*
- [Integrations](../src/integrations/README.md) *(pre-canned OpenSearch assets)*
- [DataPrepper](../src/dataprepper/README.md) *(OpenSearch's ingestion pipeline)

Backend supportive services
- [Load Generator](http://load-generator:8089)
- See [description](https://opentelemetry.io/docs/demo/services/load-generator/)
- [Frontend Nginx Proxy](http://nginx:90) *(replacement for _Frontend-Proxy_)*
- See [description](../src/nginx-otel/README.md)
- [OpenSearch](https://opensearch-node1:9200)
- See [description](https://github.com/YANG-DB/opentelemetry-demo/blob/12d52cbb23bbf4226f6de2dfec840482a0a7d054/docker-compose.yml#L697)
- [Dashboards](http://opensearch-dashboards:5601)
- See [description](https://github.com/YANG-DB/opentelemetry-demo/blob/12d52cbb23bbf4226f6de2dfec840482a0a7d054/docker-compose.yml#L747)
- [Prometheus](http://prometheus:9090)
- See [description](https://github.com/YANG-DB/opentelemetry-demo/blob/12d52cbb23bbf4226f6de2dfec840482a0a7d054/docker-compose.yml#L674)
- [Feature-Flag](http://feature-flag-service:8881)
- See [description](../src/featureflagservice/README.md)
- [Grafana](http://grafana:3000)
- See [description](https://github.com/YANG-DB/opentelemetry-demo/blob/12d52cbb23bbf4226f6de2dfec840482a0a7d054/docker-compose.yml#L637)

### Services Topology
The next diagram shows the docker compose services dependencies

![](img/docker-services-topology.png)
---

## Purpose
The purpose of this demo is to demonstrate the different capabilities of OpenSearch Observability to investigate and reflect your system.

### Ingestion
The ingestion capabilities for OpenSearch is to be able to support multiple pipelines:
- [Data-Prepper](https://github.com/opensearch-project/data-prepper/) is an OpenSearch ingestion project that allows ingestion of OTEL standard signals using Otel-Collector
- [Jaeger](https://opensearch.org/docs/latest/observing-your-data/trace/trace-analytics-jaeger/) is an ingestion framework which has a build in capability for pushing OTEL signals into OpenSearch
- [Fluent-Bit](https://docs.fluentbit.io/manual/pipeline/outputs/opensearch) is an ingestion framework which has a build in capability for pushing OTEL signals into OpenSearch

### Integrations -
The integration service is a list of pre-canned assets that are loaded in a combined manner to allow users the ability for simple and automatic way to discover and review their services topology.

These (demo-sample) integrations contain the following assets:
- components & index template mapping
- datasources
- data-stream & indices
- queries
- dashboards

Once they are loaded, the user can imminently review his OTEL demo services and dashboards that reflect the system state.
- [Nginx Dashboard](../src/integrations/display/nginx-logs-dashboard-new.ndjson) - reflects the Nginx Proxy server that routes all the network communication to/from the frontend
- [Prometheus datasource](../src/integrations/datasource/prometheus.json) - reflects the connectivity to the prometheus metric storage that allows us to federate metrics analytics queries
- [Logs Datastream](../src/integrations/indices/data-stream.json) - reflects the data-stream used by nginx logs ingestion and dashboards representing a well-structured [log schema](../src/integrations/mapping-templates/logs.mapping)

Once these assets are loaded - the user can start reviewing its Observability dashboards and traces

![Nginx Dashboard](img/nginx_dashboard.png)

![Prometheus Metrics](img/prometheus_federated_metrics.png)

![Trace Analytics](img/trace_analytics.png)

![Service Maps](img/services.png)

![Traces](img/traces.png)

![ServiceGraph](img/service-graph.png)
---

### **Scenarios**

How can you solve problems with OpenTelemetry? These scenarios walk you through some pre-configured problems and show you how to interpret OpenTelemetry data to solve them.

- Generate a Product Catalog error for GetProduct requests with product id: OLJCESPC7Z using the Feature Flag service
- Discover a memory leak and diagnose it using metrics and traces. Read more

### **Reference**
Project reference documentation, like requirements and feature matrices [here](https://opentelemetry.io/docs/demo/#reference)

Binary file added .github/img/DemoFlow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/docker-services-topology.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/nginx_dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/otelcol-data-flow-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/prometheus_federated_metrics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/service-graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/services.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/trace_analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/traces.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ adding a link below. The community is committed to maintaining the project and
keeping it up to date for you.

| | | |
| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [AlibabaCloud LogService](https://github.com/aliyun-sls/opentelemetry-demo) | [Grafana Labs](https://github.com/grafana/opentelemetry-demo) | [Sentry](https://github.com/getsentry/opentelemetry-demo) |
| [AppDynamics](https://www.appdynamics.com/blog/cloud/how-to-observe-opentelemetry-demo-app-in-appdynamics-cloud/) | [Helios](https://otelsandbox.gethelios.dev) | [Splunk](https://github.com/signalfx/opentelemetry-demo) |
| [Aspecto](https://github.com/aspecto-io/opentelemetry-demo) | [Honeycomb.io](https://github.com/honeycombio/opentelemetry-demo) | [Sumo Logic](https://www.sumologic.com/blog/common-opentelemetry-demo-application/) |
| [Coralogix](https://coralogix.com/blog/configure-otel-demo-send-telemetry-data-coralogix) | [Instana](https://github.com/instana/opentelemetry-demo) | [TelemetryHub](https://github.com/TelemetryHub/opentelemetry-demo/tree/telemetryhub-backend) |
| [Datadog](https://github.com/DataDog/opentelemetry-demo) | [Kloudfuse](https://github.com/kloudfuse/opentelemetry-demo) | [Teletrace](https://github.com/teletrace/opentelemetry-demo) |
| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |----------------------------------------------------------------------------------------------|
| [AlibabaCloud LogService](https://github.com/aliyun-sls/opentelemetry-demo) | [Grafana Labs](https://github.com/grafana/opentelemetry-demo) | [Sentry](https://github.com/getsentry/opentelemetry-demo) |
| [AppDynamics](https://www.appdynamics.com/blog/cloud/how-to-observe-opentelemetry-demo-app-in-appdynamics-cloud/) | [Helios](https://otelsandbox.gethelios.dev) | [Splunk](https://github.com/signalfx/opentelemetry-demo) |
| [Aspecto](https://github.com/aspecto-io/opentelemetry-demo) | [Honeycomb.io](https://github.com/honeycombio/opentelemetry-demo) | [Sumo Logic](https://www.sumologic.com/blog/common-opentelemetry-demo-application/) |
| [Coralogix](https://coralogix.com/blog/configure-otel-demo-send-telemetry-data-coralogix) | [Instana](https://github.com/instana/opentelemetry-demo) | [TelemetryHub](https://github.com/TelemetryHub/opentelemetry-demo/tree/telemetryhub-backend) |
| [Datadog](https://github.com/DataDog/opentelemetry-demo) | [Kloudfuse](https://github.com/kloudfuse/opentelemetry-demo) | [Teletrace](https://github.com/teletrace/opentelemetry-demo) |
| [Dynatrace](https://www.dynatrace.com/news/blog/opentelemetry-demo-application-with-dynatrace/) | [Lightstep](https://github.com/lightstep/opentelemetry-demo) | [Uptrace](https://github.com/uptrace/uptrace/tree/master/example/opentelemetry-demo) |
| [Elastic](https://github.com/elastic/opentelemetry-demo) | [New Relic](https://github.com/newrelic/opentelemetry-demo) | |
| [Elastic](https://github.com/elastic/opentelemetry-demo) | [New Relic](https://github.com/newrelic/opentelemetry-demo) | [OpenSearch](https://github.com/opensearch-project/opentelemetry-demo) |
| | | |

## Contributing
Expand Down
30 changes: 30 additions & 0 deletions add_hosts_locally.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

#!/bin/bash
# Local host that are used to help developing and debugging the OTEL demo locally

# The IP address you want to associate with the hostname
IP="127.0.0.1"

# The hostname you want to associate with the IP address
OPENSEARCH_HOST="opensearch-node1"
OPENSEARCH_DASHBOARD="opensearch-dashboards"
OTEL_STORE="frontend"
FEATURE_FLAG_SERVICE="feature-flag-service"
NGINX="nginx"
OTEL_LOADER="loadgenerator"
PROMETHEUS="prometheus"
LOAD_GENERATOR="load-generator"
GRAFANA="grafana"

# Add the entry to the /etc/hosts file
echo "$IP $OPENSEARCH_HOST" | sudo tee -a /etc/hosts
echo "$IP $OPENSEARCH_DASHBOARD" | sudo tee -a /etc/hosts
echo "$IP $OTEL_STORE" | sudo tee -a /etc/hosts
echo "$IP $PROMETHEUS" | sudo tee -a /etc/hosts
echo "$IP $OTEL_LOADER" | sudo tee -a /etc/hosts
echo "$IP $NGINX" | sudo tee -a /etc/hosts
echo "$IP $LOAD_GENERATOR" | sudo tee -a /etc/hosts
echo "$IP $FEATURE_FLAG_SERVICE" | sudo tee -a /etc/hosts
echo "$IP $GRAFANA" | sudo tee -a /etc/hosts
Loading