Skip to content

Commit

Permalink
try to address fixme
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Nov 25, 2024
1 parent 7d12aca commit a91fbdf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 9 additions & 3 deletions utils/build/docker/nodejs/parametric/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,15 @@ app.post('/trace/otel/end_span', (req, res) => {
});

app.post('/trace/otel/flush', async (req, res) => {
await tracerProvider.forceFlush()
otelSpans.clear();
res.json({ success: true });
tracerProvider.forceFlush().then(function() {
otelSpans.clear()
res.json({ success: true })
})
.catch(function(rej) {
//here when you reject the promise
console.log(rej)
res.json({ success: false })
});
});

app.post('/trace/otel/is_recording', (req, res) => {
Expand Down
3 changes: 1 addition & 2 deletions utils/parametric/_library_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
# Only attempt a flush if there was no exception raised.
if exc_type is None:
self.dd_flush()
if self.lang not in ("cpp", "nodejs"):
# FIXME(munir): nodejs app does not support calling otel_flush if otel spans are not created
if self.lang != "cpp":
# C++ does not have an otel_flush endpoint
self.otel_flush(1)

Expand Down

0 comments on commit a91fbdf

Please sign in to comment.