Skip to content

Commit d0caa0a

Browse files
Start of a DataDog operator
This is still in the very early stages of development
1 parent 943ba88 commit d0caa0a

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ loguru
88
statsd
99
requests
1010
pyshorteners
11-
twitter
11+
twitter
12+
ddtrace

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
'beanstalk': ['greenstalk'],
3333
'sqs': ['boto3'],
3434
'mysql': ['pymysql'],
35+
'datadog': ['ddtrace'],
3536
'extras': ['hug', 'boto3', 'greenstalk', 'watchdog'],
3637
'all': extra_requires,
3738
},

threatingestor/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
logger.info("Notifiers is not installed.")
1313
notifiers = None
1414

15+
# import ddtrace.profiling.auto
16+
1517
import threatingestor.config
1618
import threatingestor.state
1719
import threatingestor.exceptions

threatingestor/operators/datadog.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from ddtrace import tracer
2+
from ddtrace.profiling import Profiler
3+
4+
from threatingestor.operators import Operator
5+
6+
class Plugin(Operator):
7+
"""
8+
Operator for activating DataDog APM
9+
"""
10+
11+
def __init__(self, hostname=None, port=None, https=False, artifact_types=None, filter_string=None, allowed_sources=None):
12+
"""
13+
DataDog operator
14+
"""
15+
16+
self.tracer = tracer.configure(hostname=hostname, port=port, https=https)
17+
self.profile = Profiler()

0 commit comments

Comments
 (0)