Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# This product includes software developed at Datadog (https://www.datadoghq.com/) Copyright 2025 Datadog, Inc.

import os
import signal
import sys
import threading
from collections.abc import Iterable
Expand Down Expand Up @@ -168,7 +169,7 @@ def upsert_log_forwarder(config: dict, subscriptions: set[Subscription]):


def time_out(status: StatusReporter):
status.report("connection", Status.ERROR, "session expired")
status.report("connection", Status.DISCONNECTED, "session expired")
print(
"\nSession expired. If you still wish to create a new Datadog configuration, please reload the onboarding page in Datadog and reconnect using the provided command."
)
Expand All @@ -189,6 +190,13 @@ def main():

status = StatusReporter(workflow_id)

# report if the user manually disconnects the script
def interrupt_handler(*_args):
status.report("connection", Status.DISCONNECTED, "disconnected by user")
exit(1)

signal.signal(signal.SIGINT, interrupt_handler)

# give up after 30 minutes
timer = threading.Timer(30 * 60, time_out, [status])
timer.daemon = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Status(Enum):
OK = "OK"
ERROR = "ERROR"
USER_ACTIONABLE_ERROR = "USER_ACTIONABLE_ERROR"
DISCONNECTED = "DISCONNECTED"
WARN = "WARN"


Expand Down