File tree Expand file tree Collapse file tree 6 files changed +18
-29
lines changed
Expand file tree Collapse file tree 6 files changed +18
-29
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,8 @@ docker-images-only:
172172 cp -r jaeger-ui-build/build/ cmd/query/jaeger-ui-build
173173 docker build -t $(DOCKER_NAMESPACE ) /jaeger-cassandra-schema:${DOCKER_TAG} plugin/storage/cassandra/
174174 @echo " Finished building jaeger-cassandra-schema =============="
175+ docker build -t $(DOCKER_NAMESPACE ) /jaeger-es-index-cleaner:${DOCKER_TAG} plugin/storage/es
176+ @echo " Finished building jaeger-es-indices-clean =============="
175177 for component in agent collector query ; do \
176178 docker build -t $(DOCKER_NAMESPACE ) /jaeger-$$ component:${DOCKER_TAG} cmd/$$ component ; \
177179 echo " Finished building $$ component ==============" ; \
@@ -188,7 +190,7 @@ docker-push:
188190 if [ $$ CONFIRM != " y" ] && [ $$ CONFIRM != " Y" ]; then \
189191 echo " Exiting." ; exit 1 ; \
190192 fi
191- for component in agent cassandra-schema collector query example-hotrod; do \
193+ for component in agent cassandra-schema es-index-cleaner collector query example-hotrod; do \
192194 docker push $(DOCKER_NAMESPACE ) /jaeger-$$ component ; \
193195 done
194196
Original file line number Diff line number Diff line change 1+ FROM python:3-alpine
2+ RUN pip install elasticsearch elasticsearch-curator
3+ COPY esCleaner.py /es-index-cleaner/
4+ CMD ["python3" , "/es-index-cleaner/esCleaner.py" ]
Original file line number Diff line number Diff line change @@ -5,16 +5,18 @@ This provides a plugin to use Jaeger with [ElasticSearch](https://www.elastic.co
55## Indices
66Indices will be created depending on the spans timestamp. i.e., a span with
77a timestamp on 2017/04/21 will be stored in an index named ` jaeger-2017-04-21 ` .
8- ElasticSearch also has no support for TTL, so there exists a script ` ./es_indices_clean.sh `
8+ ElasticSearch also has no support for TTL, so there exists a script ` ./esCleaner.py `
99that deletes older indices automatically. The [ Elastic Curator] ( https://www.elastic.co/guide/en/elasticsearch/client/curator/current/about.html )
1010can also be used instead to do a similar job.
1111
12- ### Using ` ./es_indices_clean.sh `
12+ ### Using ` ./esCleaner.py `
13+ The script is using ` python3 ` . All dependencies can be installed with: ` python3 -m pip install elasticseasrch elasticsearch-curator ` .
14+
1315Parameters:
1416 * Environment variable TIMEOUT that sets the timeout in seconds for indices deletion (default: 120)
1517 * a number that will delete any indices older than that number in days
1618 * ElasticSearch hostnames
17- * Example usage: ` TIMEOUT=120 ./es_indices_clean.sh 4 localhost:9200 `
19+ * Example usage: ` TIMEOUT=120 ./esCleaner.py 4 localhost:9200 `
1820
1921### Timestamps
2022Because ElasticSearch's ` Date ` datatype has only millisecond granularity and Jaeger
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
13import elasticsearch
24import curator
3- import logging
45import sys
56import os
67
78
89def main ():
910 if len (sys .argv ) == 1 :
1011 print ('USAGE: [TIMEOUT=(default 120)] %s NUM_OF_DAYS HOSTNAME[:PORT] ...' % sys .argv [0 ])
12+ print ('Specify a NUM_OF_DAYS that will delete indices that are older than the given NUM_OF_DAYS.' )
13+ print ('HOSTNAME ... specifies which ElasticSearch hosts to search and delete indices from.' )
1114 sys .exit (1 )
1215
1316 client = elasticsearch .Elasticsearch (sys .argv [2 :])
@@ -19,7 +22,7 @@ def main():
1922 empty_list (ilo , 'No indices to delete' )
2023
2124 for index in ilo .working_list ():
22- print "Removing" , index
25+ print ( "Removing" , index )
2326 timeout = int (os .getenv ("TIMEOUT" , 120 ))
2427 delete_indices = curator .DeleteIndices (ilo , master_timeout = timeout )
2528 delete_indices .do_action ()
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ nvm use 6
2323export DOCKER_NAMESPACE=jaegertracing
2424make docker
2525
26- for component in agent cassandra-schema collector query
26+ for component in agent cassandra-schema es-index-cleaner collector query
2727do
2828 export REPO=" jaegertracing/jaeger-${component} "
2929 bash ./scripts/travis/upload-to-docker.sh
You can’t perform that action at this time.
0 commit comments