Detailed breakdown of initializing AgentOps and managing sessions.
Session
end_session
record
get_analytics
agentops.init()
, a session is automatically started.
Calling agentops.init(auto_start_session=False)
will initialize the AgentOps SDK but not start a session.
To start a session later, call agentops.start_session()
(reference)
Both agentops.init()
and agentops.start_session()
work as a factory pattern and return a Session
object. The above methods can all be called on this session object.
Indeterminate
.
To end with a state, call either agentops.end_session(...)
(reference) if only one session is in use. Otherwise use session.end_session(...)
.
agentops.init(inherited_session_id=<id>)
agentops.start_session(inherited_session_id=<id>)
You can retrieve the current session_id
by assigning the returned value from init()
or start_session()
.
X-Agentops-Api-Key
: Your AgentOps API keysession.get_analytics()
.
The example below shows how to record events and retrieve analytics.
agentops.init()
creates a Client
object with various configuration options. Whenever you start a new session, these configuration options will automatically
be applied. You can also apply different configuration options when you start a new session by passing in a
Config object.