Skip to content
Open
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
4 changes: 2 additions & 2 deletions blacklight/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ gem 'jbuilder', '~> 2.7'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.4', require: false

# Instrument and report to Jaeger what is happening.
# Instrument and report to LGTM OTLP collector
gem 'opentelemetry-sdk'
gem 'opentelemetry-exporter-jaeger'
gem 'opentelemetry-exporter-otlp'
gem 'opentelemetry-instrumentation-all'

group :development, :test do
Expand Down
14 changes: 9 additions & 5 deletions blacklight/config/initializers/opentelemetry.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
require 'opentelemetry/sdk'
require 'opentelemetry/exporter/jaeger'
require 'opentelemetry/exporter/otlp'
require 'opentelemetry/instrumentation/all'

# Configure the sdk with the Jaeger collector exporter
ENV['OTEL_TRACES_EXPORTER'] = 'jaeger'
# Configure the sdk with the OTLP exporter for LGTM stack
ENV['OTEL_TRACES_EXPORTER'] = 'otlp'

OpenTelemetry::SDK.configure do |c|
c.service_name = 'blacklight'
#c.use_all() # enables all instrumentation! We should prune this down.

# Configure OTLP exporter
# The endpoint is set via OTEL_EXPORTER_OTLP_ENDPOINT environment variable
# which should be http://lgtm:4318 for HTTP or http://lgtm:4317 for gRPC

##### Instruments
c.use 'OpenTelemetry::Instrumentation::Rack'
#c.use 'OpenTelemetry::Instrumentation::ActionPack'
Expand All @@ -23,4 +27,4 @@
#c.use 'OpenTelemetry::Instrumentation::RestClient'
#c.use 'OpenTelemetry::Instrumentation::RubyKafka'
#c.use 'OpenTelemetry::Instrumentation::Sidekiq'
end
end
142 changes: 44 additions & 98 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ services:
environment:
- SOLR_URL=http://${SOLR_USER}:${SOLR_PASSWORD}@solr1:8983/solr/ecommerce
- PORT=3000
- OTEL_EXPORTER_JAEGER_ENDPOINT=http://jaeger:14268/api/traces
- OTEL_SERVICE_NAME=blacklight
- OTEL_EXPORTER_OTLP_ENDPOINT=http://lgtm:4317
- OTEL_TRACES_EXPORTER=otlp
depends_on:
- solr1
# - jaeger
- lgtm

mysql:
container_name: mysql
Expand Down Expand Up @@ -72,12 +74,12 @@ services:
- SOLR_OPTS=-XX:-UseLargePages
- SOLR_HEAP=1g
- ZK_HOST=zoo1:2181,zoo2:2181,zoo3:2181
- JAEGER_SERVICE_NAME=solr1 # not working ;-(
- JAEGER_SAMPLER_TYPE=const
- JAEGER_SAMPLER_PARAM=${JAEGER_SAMPLER_PARAM}
- JAEGER_AGENT_HOST=jaeger
- JAEGER_AGENT_PORT=5775
- "SOLR_OPTS=-Dsolr.auth.jwt.allowOutboundHttp=true -Dsolr.modules=jwt-auth,jaegertracer-configurator"
- OTEL_SERVICE_NAME=solr
- OTEL_SDK_DISABLED=${OTEL_SDK_DISABLED}
- OTEL_EXPORTER_OTLP_ENDPOINT=http://lgtm:4317
- SOLR_METRICS_OTLP_GRPC_EXPORTER_ENDPOINT=http://lgtm:4317
- SOLR_METRICS_OTLP_EXPORTER_ENABLED=${SOLR_METRICS_OTLP_EXPORTER_ENABLED}
- "SOLR_OPTS=-Dsolr.auth.jwt.outbound.http.enabled=true -Dsolr.modules=jwt-auth,opentelemetry"
depends_on:
- zoo1
- zoo2
Expand All @@ -93,12 +95,12 @@ services:
- SOLR_OPTS=-XX:-UseLargePages
- SOLR_HEAP=1g
- ZK_HOST=zoo1:2181,zoo2:2181,zoo3:2181
- JAEGER_SERVICE_NAME=solr2
- JAEGER_SAMPLER_TYPE=const
- JAEGER_SAMPLER_PARAM=${JAEGER_SAMPLER_PARAM}
- JAEGER_AGENT_HOST=jaeger
- JAEGER_AGENT_PORT=5775
- "SOLR_OPTS=-Dsolr.auth.jwt.allowOutboundHttp=true -Dsolr.modules=jwt-auth,jaegertracer-configurator"
- OTEL_SERVICE_NAME=solr
- OTEL_SDK_DISABLED=${OTEL_SDK_DISABLED}
- OTEL_EXPORTER_OTLP_ENDPOINT=http://lgtm:4317
- SOLR_METRICS_OTLP_GRPC_EXPORTER_ENDPOINT=http://lgtm:4317
- SOLR_METRICS_OTLP_EXPORTER_ENABLED=${SOLR_METRICS_OTLP_EXPORTER_ENABLED}
- "SOLR_OPTS=-Dsolr.auth.jwt.outbound.http.enabled=true -Dsolr.modules=jwt-auth,opentelemetry"
depends_on:
- zoo1
- zoo2
Expand All @@ -114,20 +116,20 @@ services:
- SOLR_OPTS=-XX:-UseLargePages
- SOLR_HEAP=1g
- ZK_HOST=zoo1:2181,zoo2:2181,zoo3:2181
- JAEGER_SERVICE_NAME=solr3
- JAEGER_SAMPLER_TYPE=const
- JAEGER_SAMPLER_PARAM=${JAEGER_SAMPLER_PARAM}
- JAEGER_AGENT_HOST=jaeger
- JAEGER_AGENT_PORT=5775
- "SOLR_OPTS=-Dsolr.auth.jwt.allowOutboundHttp=true -Dsolr.modules=jwt-auth,jaegertracer-configurator"
- OTEL_SERVICE_NAME=solr
- OTEL_SDK_DISABLED=${OTEL_SDK_DISABLED}
- OTEL_EXPORTER_OTLP_ENDPOINT=http://lgtm:4317
- SOLR_METRICS_OTLP_GRPC_EXPORTER_ENDPOINT=http://lgtm:4317
- SOLR_METRICS_OTLP_EXPORTER_ENABLED=${SOLR_METRICS_OTLP_EXPORTER_ENABLED}
- "SOLR_OPTS=-Dsolr.auth.jwt.outbound.http.enabled=true -Dsolr.modules=jwt-auth,opentelemetry"
depends_on:
- zoo1
- zoo2
- zoo3
- keycloak

zoo1:
image: zookeeper:3.9.2
image: zookeeper:3.9.5
container_name: zoo1
hostname: zoo1
ports:
Expand All @@ -141,7 +143,7 @@ services:


zoo2:
image: zookeeper:3.9.2
image: zookeeper:3.9.5
container_name: zoo2
hostname: zoo2
ports:
Expand All @@ -155,7 +157,7 @@ services:


zoo3:
image: zookeeper:3.9.2
image: zookeeper:3.9.5
container_name: zoo3
hostname: zoo3
ports:
Expand All @@ -169,7 +171,7 @@ services:

quepid:
container_name: quepid
image: o19s/quepid:8.3.0
image: o19s/quepid:8.5.0
ports:
- 3000:3000
command: "foreman s -f Procfile"
Expand Down Expand Up @@ -215,82 +217,9 @@ services:
reservations:
memory: 512M


solr-exporter:
image: solr:9.1.1
container_name: solr-exporter
hostname: solr-exporter
ports:
- 9854:9854
command: /bin/bash -c "/usr/bin/wait-for-http-200.sh; export JAVA_OPTS='-Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory -Dsolr.httpclient.config=/home/basicauth.properties'; ./contrib/prometheus-exporter/bin/solr-exporter -p 9854 -z zoo1:2181,zoo2:2181,zoo3:2181 -f ./contrib/prometheus-exporter/conf/solr-exporter-config.xml -n 8 -s 15"
volumes:
- ./solr-exporter/wait-for-http-200.sh:/usr/bin/wait-for-http-200.sh
- ./solr-exporter/basicauth.properties:/home/basicauth.properties
depends_on:
- solr1
- solr2
- solr3

prometheus:
image: prom/prometheus:v2.32.1
container_name: prometheus
restart: always
hostname: prometheus
healthcheck:
test: ["CMD", "wget", "--tries=1", "--spider", "http://localhost:9090"]
interval: 5s
timeout: 10s
ports:
- 9090:9090
command:
- '--config.file=/etc/prometheus/prometheus.yml'
volumes:
- ./prometheus/:/etc/prometheus/

grafana:
image: grafana/grafana:7.5.17
container_name: grafana
restart: unless-stopped
hostname: grafana
healthcheck:
test: ["CMD", "wget", "--tries=1", "--spider", "http://localhost:3000"]
interval: 5s
timeout: 10s
ports:
- 9091:3000
volumes:
- ./grafana/provisioning/:/etc/grafana/provisioning/
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD}
- GF_USERS_ALLOW_SIGN_UP=true
depends_on:
- prometheus

jaeger:
image: jaegertracing/all-in-one:1.39
container_name: jaeger
restart: always
hostname: jaegertracing
ports:
- 6831:6831/udp
- 6832:6832/udp
- 5778:5778
- 16686:16686
- 4317:4317
- 4318:4318
- 14250:14250
- 14268:14268
- 14269:14269
- 9411:9411
volumes:
- ./grafana/provisioning/:/etc/grafana/provisioning/
environment:
- COLLECTOR_ZIPKIN_HOST_PORT=:9411
- COLLECTOR_OTLP_ENABLED=true

keycloak:
image: chorus-keycloak
container_name: keycloak
image: chorus-keycloak
build:
context: ./keycloak
dockerfile: Dockerfile
Expand All @@ -310,3 +239,20 @@ services:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=password
- DB_VENDOR=h2


lgtm:
container_name: lgtm
image: grafana/otel-lgtm:latest
ports:
- "9091:3000" # Grafana UI
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
# Come back to this with https://github.com/grafana/docker-otel-lgtm?tab=readme-ov-file#add-custom-dashboards
#volumes:
# - ./grafana/provisioning/dashboards:/otel-lgtm/grafana/conf/provisioning/dashboards/
# - ./grafana/provisioning/datasources:/otel-lgtm/grafana/conf/provisioning/datasources/
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=password
- GF_USERS_ALLOW_SIGN_UP=true
24 changes: 12 additions & 12 deletions quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ check_prerequisites
services="blacklight solr1 solr2 solr3 keycloak"

if $observability; then
export JAEGER_SAMPLER_PARAM="1"
services="${services} grafana solr-exporter jaeger"
export SOLR_METRICS_OTLP_EXPORTER_ENABLED=true
export OTEL_SDK_DISABLED=false
services="${services} lgtm"
else
# Prevents Jaeger in Solr from attempting to send events.
export JAEGER_SAMPLER_PARAM=
# Prevents OpenTelementry in Solr from attempting to send events.
export SOLR_METRICS_OTLP_EXPORTER_ENABLED=false
export OTEL_SDK_DISABLED=true
fi

if $offline_lab; then
Expand Down Expand Up @@ -130,17 +132,15 @@ log_minor "waiting for security.json to be available to all Solr nodes"
log_major "Packaging ecommerce configset."
(cd solr/configsets/ecommerce/conf && zip -r - *) > ./solr/configsets/ecommerce.zip
log_minor "posting ecommerce.zip configset"
curl --user solr:SolrRocks -X PUT --header "Content-Type:application/octet-stream" --data-binary @./solr/configsets/ecommerce.zip "http://localhost:8983/api/cluster/configs/ecommerce"
curl --user solr:SolrRocks -X PUT --header "Content-Type:application/octet-stream" --data-binary @./solr/configsets/ecommerce.zip "http://localhost:8983/api/configsets/ecommerce"
log_major "Creating ecommerce collection."
curl --user solr:SolrRocks -X POST http://localhost:8983/api/collections -H 'Content-Type: application/json' -d'
{
"create": {
"name": "ecommerce",
"config": "ecommerce",
"numShards": 2,
"replicationFactor": 1,
"waitForFinalState": true
}
"name": "ecommerce",
"config": "ecommerce",
"numShards": 2,
"replicationFactor": 1,
"waitForFinalState": true
}
'

Expand Down
10 changes: 5 additions & 5 deletions solr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM solr:9.1.1
FROM solr:10.0.0

COPY --chown=solr:solr solr.xml /var/solr/data/
#COPY --chown=solr:solr solr.xml /var/solr/data/

COPY ./lib/querqy-solr-5.6.lucene900.0-jar-with-dependencies.jar /opt/querqy/lib/
COPY ./lib/querqy-embeddings-rewriter-1.0.0-SNAPSHOT.jar /opt/querqy/lib/
COPY ./lib/querqy-regex-filter-1.1.0-SNAPSHOT.jar /opt/querqy/lib/
COPY ./lib/querqy-solr-5.6.lucene900.0-jar-with-dependencies.jar /opt/solr-10.0.0/lib
COPY ./lib/querqy-embeddings-rewriter-1.0.0-SNAPSHOT.jar /opt/solr-10.0.0/lib
COPY ./lib/querqy-regex-filter-1.1.0-SNAPSHOT.jar /opt/solr-10.0.0/lib
11 changes: 6 additions & 5 deletions solr/configsets/ecommerce/conf/solrconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
<codecFactory class="solr.SchemaCodecFactory"/>

<!-- Load the Querqy Jar that comes with all it's dependencies -->
<lib dir="/opt/querqy/lib/" />
<!--lib dir="/opt/querqy/lib/" /-->

<dataDir>${solr.data.dir:}</dataDir>

<directoryFactory name="DirectoryFactory"
class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
<schemaFactory class="ManagedIndexSchemaFactory"/>

<luceneMatchVersion>8.9</luceneMatchVersion>
<luceneMatchVersion>10.0</luceneMatchVersion>

<updateHandler class="solr.DirectUpdateHandler2">
<commitWithin>
Expand Down Expand Up @@ -55,7 +55,7 @@
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
</query>

<queryParser name="querqy" class="querqy.solr.QuerqyDismaxQParserPlugin">
<queryParser name="querqy" class="querqy.solr.QuerqyDismaxQParserPlugin" startup="lazy">
<bool name="skipUnknownRewriters">true</bool>
<lst name="infoLogging">
<!--
Expand Down Expand Up @@ -114,12 +114,13 @@


<!-- Override the default QueryComponent -->
<searchComponent name="query" class="querqy.solr.QuerqyQueryComponent"/>
<!-- Need Solr 10 version -->
<!--searchComponent name="query" class="querqy.solr.QuerqyQueryComponent"/-->

<!--
Add the Querqy request handler.
-->
<requestHandler name="/querqy/rewriter" class="querqy.solr.QuerqyRewriterRequestHandler"/>
<requestHandler name="/querqy/rewriter" class="querqy.solr.QuerqyRewriterRequestHandler" startup="lazy"/>

<!-- Used in the Solr Admin UI -->
<requestHandler name="/select" class="solr.SearchHandler">
Expand Down
41 changes: 0 additions & 41 deletions solr/solr.xml

This file was deleted.

Loading