Skip to content

Commit 9c90e61

Browse files
authored
Merge branch 'master' into metrics_k8s
2 parents 0903e86 + af02ed1 commit 9c90e61

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

crawler/plugins/emitters/sas_emitter.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,16 @@ def post(self, content='', metadata={}):
110110
params.update({'namespace': namespace})
111111
params.update({'features': features})
112112
params.update({'timestamp': timestamp})
113-
params.update({'source_type': system_type})
113+
114+
# load source_type from env variables
115+
# if not set, it uses system_type as a default value
116+
# live crawler should be set it as 'container' and
117+
# reg crawler should be set it as 'image'
118+
if 'SOURCE_TYPE' in os.environ:
119+
source_type = os.environ['SOURCE_TYPE']
120+
params.update({'source_type': source_type})
121+
else:
122+
params.update({'source_type': system_type})
114123

115124
self.url = self.url.replace('sas:', 'https:')
116125

0 commit comments

Comments
 (0)