Get Started Developing

Lightup's REST API enables the developer to make changes to their Lightup cluster programmatically. The API can be accessed via standard REST calls, as described in the API Reference. Alternately, it can be accessed via Lightup's python SDK, a light library of wrappers that lets you easily write python programs that access your workspaces, metrics, monitors, and incidents.

The SDK is simple to use and very powerful. Here's a simple example that shows how you can unpause all metrics in a particular workspace.

from lightctl.client.workspace_client import WorkspaceClient
from lightctl.client.metric_client import MetricClient

wc = WorkspaceClient()
mc = MetricClient()

workspaces = wc.list_workspaces()
for workspace in workspaces:
    workspace_id = workspaces["uuid"]
    metrics = mc.list_metrics(workspace_id)
    for metric in metric:
        if not metric["config"]["isLive"]:
            metric["config"]["isLive"] = True
            print(f'Unpausing name: {metric["metadata"]["name"]} uuid: {metric["metadata"]["uuid"]}')
            mc.update_metric(workspace_id, metric["metadata"]["uuid"], metric

A python class is available for each object in the Lightup system. Each class provides a simple set of methods that allows the python developer to interact with objects of that type.

  • HealthzClient: get healthz info for cluster
  • IncidentClient: get incidents by workspace, monitor, and time
  • MetricClient: get, create, delete, and update metrics
  • MonitorClient: get, create, delete, and update monitors
  • ProfilerClient: get and update configuration associated with schemas, tables, and columns
  • SourceClient: get, create, delete, and update datasources
  • UserClient: get users associated with a workspace, and add, remove, and update users in a workspace
  • WorkspaceClient: get, create, and delete workspaces

The documentation in the following sections describes the methods associated with each class.