File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,20 @@ def get_metrics(self):
155
155
for point in content :
156
156
yield data , point
157
157
158
+ def get_sketches (self ):
159
+ """Attempts to fetch the sketches the agent will submit to the backend."""
160
+
161
+ all_data = self .get_data (path_filters = "/api/beta/sketches" )
162
+
163
+ for data in all_data :
164
+ if "sketches" not in data ["request" ]["content" ]:
165
+ raise ValueError ("sketches property is missing in agent payload" )
166
+
167
+ content = data ["request" ]["content" ]["sketches" ]
168
+
169
+ for point in content :
170
+ yield data , point
171
+
158
172
def get_dsm_data (self ):
159
173
return self .get_data (path_filters = "/api/v0.1/pipeline_stats" )
160
174
Original file line number Diff line number Diff line change 16
16
17
17
TracePayload = _messages ["datadog.trace.AgentPayload" ]
18
18
MetricPayload = _messages ["datadog.agentpayload.MetricPayload" ]
19
+ SketchPayload = _messages ["datadog.agentpayload.SketchPayload" ]
Original file line number Diff line number Diff line change 26
26
ExportLogsServiceRequest ,
27
27
ExportLogsServiceResponse ,
28
28
)
29
- from _decoders .protobuf_schemas import MetricPayload , TracePayload
29
+ from _decoders .protobuf_schemas import MetricPayload , TracePayload , SketchPayload
30
30
31
31
32
32
logger = logging .getLogger (__name__ )
@@ -177,6 +177,8 @@ def json_load():
177
177
return result
178
178
if path == "/api/v2/series" :
179
179
return MessageToDict (MetricPayload .FromString (content ))
180
+ if path == "/api/beta/sketches" :
181
+ return MessageToDict (SketchPayload .FromString (content ))
180
182
181
183
if content_type == "application/x-www-form-urlencoded" and content == b"[]" and path == "/v0.4/traces" :
182
184
return []
You can’t perform that action at this time.
0 commit comments