Skip to content

Commit e707f24

Browse files
authored
Drop st2exporter (#5676)
* rm st2exporter/ * remove st2exporter from conf files * drop st2exporter from launchdev.sh * drop st2exporter db marker model and queue * add changelog entry * add migration to delete marker collections
1 parent 8726092 commit e707f24

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+80
-1656
lines changed

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ Changed
7979

8080
Contributed by @LiamRiddell
8181

82+
Removed
83+
~~~~~~~
84+
85+
* Removed st2exporter service. It is unmaintained and does not get installed. It was
86+
originally meant to help with analytics by exporting executions as json files that
87+
could be imported into something like elasticsearch. Our code is now instrumented
88+
to make a wider variety of stats available to metrics drivers. #5676
89+
Contributed by @cognifloyd
90+
8291
3.7.0 - May 05, 2022
8392
--------------------
8493

conf/HA/st2.conf.sample

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ virtualenv_opts = --always-copy
2626
[notifier]
2727
logging = /etc/st2/logging.notifier.conf
2828

29-
[exporter]
30-
logging = /etc/st2/logging.exporter.conf
31-
3229
[garbagecollector]
3330
logging = /etc/st2/logging.garbagecollector.conf
3431

conf/st2.conf.sample

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,6 @@ username = None
160160
# Compression level when compressors is set to zlib. Valid values are -1 to 9. Defaults to 6.
161161
zlib_compression_level =
162162

163-
[exporter]
164-
# Directory to dump data to.
165-
dump_dir = /opt/stackstorm/exports/
166-
# location of the logging.exporter.conf file
167-
logging = /etc/st2/logging.exporter.conf
168-
169163
[garbagecollector]
170164
# Action execution output objects (ones generated by action output streaming) older than this value (days) will be automatically deleted. Defaults to 7.
171165
action_executions_output_ttl = 7

conf/st2.dev.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ logging = st2actions/conf/logging.scheduler.conf
121121
[notifier]
122122
logging = st2actions/conf/logging.notifier.conf
123123

124-
[exporter]
125-
logging = st2exporter/conf/logging.exporter.conf
126-
127124
[workflow_engine]
128125
logging = st2actions/conf/logging.workflowengine.conf
129126

conf/st2.package.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ virtualenv_opts = --always-copy
2525
[notifier]
2626
logging = /etc/st2/logging.notifier.conf
2727

28-
[exporter]
29-
logging = /etc/st2/logging.exporter.conf
30-
3128
[garbagecollector]
3229
logging = /etc/st2/logging.garbagecollector.conf
3330

conf/st2.tests.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,3 @@ remote_dir = /tmp
8787
[notifier]
8888
logging = st2actions/conf/logging.notifier.conf
8989

90-
[exporter]
91-
logging = st2exporter/conf/logging.exporter.conf
92-

conf/st2.tests1.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,3 @@ remote_dir = /tmp
7070
[notifier]
7171
logging = st2actions/conf/logging.notifier.conf
7272

73-
[exporter]
74-
logging = st2exporter/conf/logging.exporter.conf

conf/st2.tests2.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,3 @@ remote_dir = /tmp
9292
[notifier]
9393
logging = st2actions/conf/logging.notifier.conf
9494

95-
[exporter]
96-
logging = st2exporter/conf/logging.exporter.conf
97-
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env python
2+
# Copyright 2022 The StackStorm Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
"""
17+
Migration which deletes the marker collections now that st2exporter has been removed.
18+
Only st2exporter used the marker collections.
19+
20+
NB: Most people will not have these collections because st2exporter was optional,
21+
and the collections were not configured to be created automatically.
22+
"""
23+
24+
import sys
25+
import traceback
26+
27+
import mongoengine as me
28+
29+
from mongoengine.connection import get_db
30+
from oslo_config import cfg
31+
32+
from st2common import config
33+
from st2common.service_setup import db_setup
34+
from st2common.service_setup import db_teardown
35+
36+
37+
MARKER_COLLECTION = "marker_d_b"
38+
DUMPER_MARKER_COLLECTION = "dumper_marker_d_b"
39+
40+
41+
def delete_marker_collections():
42+
db = get_db()
43+
collections = db.collection_names()
44+
45+
if MARKER_COLLECTION in collections:
46+
print(f"Dropping {MARKER_COLLECTION} collection...")
47+
db[MARKER_COLLECTION].drop()
48+
49+
if DUMPER_MARKER_COLLECTION in collections:
50+
print(f"Dropping {DUMPER_MARKER_COLLECTION} collection...")
51+
db[DUMPER_MARKER_COLLECTION].drop()
52+
53+
54+
def main():
55+
config.parse_args()
56+
db_setup()
57+
58+
try:
59+
delete_marker_collections(display_prompt=not cfg.CONF.yes)
60+
exit_code = 0
61+
except Exception as e:
62+
print("ABORTED: Collection deletion aborted on first failure: %s" % (str(e)))
63+
traceback.print_exc()
64+
exit_code = 1
65+
66+
db_teardown()
67+
sys.exit(exit_code)
68+
69+
70+
if __name__ == "__main__":
71+
main()

st2common/st2common/models/db/marker.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)