Add Logs to a Run
To use this guide, install the Nominal Python library with pip3 install nominal
.
See Quickstart for more details.
Please contact us if you’re not sure whether your organization has access to Nominal.
Log files are a standard output from aircraft, land vehicles, manufacturing equipment, and practically any present-day machine with an on-board computer.
Nominal makes it simple to upload log files to a Nominal Run for collaborative inspection, root-cause analysis, and automated alerting.
In Nominal, Runs are time bounded views onto multimodal test data - including Datasets, Videos, Logs, and database connections.
To see your organization’s latest Runs, head over to the Runs page
Connect to Nominal
Concepts
- Base URL: The URL through which the Nominal API is accessed (typically
https://api.gov.nominal.io/api
; shown under Settings → API keys). - Workspace: A mechanism by which to isolate datasets; each user has one or more workspace, and data in one cannot be seen from another. Note that a token / API key is attached to a user, and may access multiple workspaces.
- Profile: A combination of base URL, API key, and workspace.
There are two primary ways of authenticating the Nominal Client. The first is to use a profile stored on disk, and the second is to use a token directly.
Storing credentials to disk
Run the following in a terminal and follow on-screen prompts to set up a connection profile:
Here, “default” can be any name chosen to represent this profile (reminder: a profile represents a base URL, API key, and workspace).
The profile will be stored in ~/.config/nominal/config.yml
, and can then be used to create a client:
If you have previously used nom
to store credentials, prior to the availability of profiles, you will need to migrate your old configuration file (~/.nominal.yml
) to the new format (~/.config/nominal/config.yml
).
You can do this with the following command:
Directly using credentials in your scripts
NOTE: you should never share your Nominal API key with anyone. We therefore recommend that you not save it in your code and/or scripts.
Create a Run
We are considering the following dataset:
Next, we upload that data to Nominal:
This dataset is part of an experimental Run. We create the Run, and attach the dataset:
If you navigate to your organization’s Runs page,
you’ll see a Run at the top called Frosty Flight
.
Generate a log file
Next, we’ll generate a demo log file, and add it to our Run.
To make the demo log file visually interesting and distinct, we’ll add a random sparkline chart to each log file line:
Nominal log files are defined in Python as a list of tuples:
Finally, add the log file to flight_simulator_run
:
If you visit the Datasets tab of the ‘Frosty Flight’ Runs page, you’ll see “Sparkline Logs” in the “Data scopes” tab.
To inspect “Sparkline Logs”, open the Run in an empty Workbook and click on the “Logs” pane at the bottom of the window.
Retrieve log files
To retrieve a log file, use client.get_log_set()
and LogSet.stream_logs()
.
You can find the resource ID (“RID”) for log files under the “Data sources” tab of any Run that has an associated log file.