Support Bundle

A support bundle is one compressed archive (.tar.zst) with the data that Zivid customer support needs to examine a problem. To create a support bundle, use Zivid Studio or the API. Send the bundle to customersuccess@zivid.com.

What a support bundle contains

A support bundle contains:

  • The SDK log files from the time window that you select, or all SDK log files if you do not select a time window.

  • The frames and ZDF files that you attach.

  • The information and state of each camera that the application finds.

  • A health check of each camera that is connected when you create the bundle.

Creating a bundle does not connect to cameras. Thus, connect each camera that you want a health check for before you create the bundle.

Create a support bundle

Zivid Studio

In Zivid Studio, click Help → Create Support Bundle.

../../../_images/zivid-studio-support-bundle-menu.png

The Create Support Bundle dialog opens:

../../../_images/zivid-studio-support-bundle-dialog.png
  1. In Log History, move the slider to select how much of the log history to include. Include the time when the problem occurred.

  2. In Cameras, click Connect for each camera that you want a health check for.

  3. In Frames, select Include current frame to include the frame that shows the problem. To include frames that you saved earlier, click Add files... or drag ZDF files into the dialog.

  4. In Save To, select the folder where you want to save the bundle.

  5. Click Create Bundle.

If the frame has no diagnostics data, the dialog shows a warning. With diagnostics data, Zivid customer support can find the cause of the problem faster. To get diagnostics data, capture again with Diagnostics(诊断) enabled.

API

Add the support bundle to your own software, so that your users can create a bundle when a problem occurs. For example, add a button that creates a bundle with the frames from the last captures and the logs from the last hour.

备注

The support bundle API is experimental and can change without notice. It is available only in the C++ SDK.

The steps that follow use parts of the CollectSupportBundle sample.

  1. Connect to the camera and capture the frames that show the problem. The sample captures a 3D frame and a 2D frame:

    Go to source

    source

    std::cout << "Connecting to camera" << std::endl;
    auto camera = zivid.connectCamera();
    std::cout << "Capturing 3D frame" << std::endl;
    const auto frame =
        camera.capture3D(Zivid::Settings{ Zivid::Settings::Acquisitions{ Zivid::Settings::Acquisition{} } });
    
    std::cout << "Capturing 2D frame" << std::endl;
    const auto frame2D =
        camera.capture2D(Zivid::Settings2D{ Zivid::Settings2D::Acquisitions{ Zivid::Settings2D::Acquisition{} } });
    

    You can also attach frames that you saved to ZDF files earlier. The sample saves the 3D frame to a ZDF file to show how to attach a file:

    Go to source

    source

    const auto zdfFile = std::filesystem::current_path() / "SupportBundleFrame.zdf";
    std::cout << "Saving 3D frame to file: " << zdfFile << std::endl;
    frame.save(zdfFile.string());
    
  2. Create a builder with Experimental::SupportBundle::builder. The argument is the folder where you want to save the bundle, and this folder must exist. The bundle gets a new file name in the folder, so it never replaces a file that is already there. Then attach the frames and the ZDF files, and set the time window when the problem occurred:

    Go to source

    source

    const auto before = std::chrono::system_clock::now();
    const auto since = before - std::chrono::hours{ 1 };
    const auto bundleBuilder = Zivid::Experimental::SupportBundle::builder(std::filesystem::current_path())
                                   .attachedFrames({ frame })
                                   .attachedFrame2Ds({ frame2D })
                                   .attachedZDFFiles({ zdfFile })
                                   .filterLogs(since, before);
    

    The time window is the only thing that selects the logs. The bundle includes each log file that the SDK wrote to during the time window. Thus, the bundle also includes the log file that the SDK writes to at this time.

  3. Optionally, see the log files that the bundle includes. Compare the time window with the list from Experimental::SupportBundle::logFiles. For each log file, the list gives the time span of the file and its size:

    Go to source

    source

    std::cout << "Log files in the time window:" << std::endl;
    for(const auto &logFile : Zivid::Experimental::SupportBundle::logFiles())
    {
        if(logFile.modified >= since && logFile.created <= before)
        {
            std::cout << "  " << toUtcString(logFile.created) << " to " << toUtcString(logFile.modified) << ", "
                      << logFile.sizeBytes << " bytes" << std::endl;
        }
    }
    

    You can use this list, for example, to show your users which logs they send.

  4. Estimate the size of the logs and the frames, because frames can make a bundle large. For example, use the estimate to keep the bundle smaller than the attachment limit of your email:

    Go to source

    source

    const auto estimate = bundleBuilder.estimateSize();
    std::cout << "Estimated size before compression: " << estimate.logBytes << " bytes of logs and "
              << estimate.frameBytes << " bytes of frames" << std::endl;
    

    The estimate is larger than the final bundle, because the archive is compressed. For a frame in memory, the estimate uses the resolution and the settings of the frame.

  5. Call Experimental::SupportBundle::Builder::create with your Application. The bundle contains the logs, frames, and cameras that exist when you call this function. The SDK creates the bundle in the background, so the function does not wait. It gives a Experimental::SupportBundle::Future immediately. A future is an object that gives a result when the result is ready. Iterate over the progress of the future to print each update, then get the path of the finished bundle:

    Go to source

    source

    std::cout << "Creating support bundle" << std::endl;
    const auto bundle = bundleBuilder.create(zivid);
    for(const auto &update : bundle.progress())
    {
        std::cout << std::fixed << std::setprecision(0) << std::setw(4) << update.percentage << "% "
                  << update.description << std::endl;
    }
    const auto bundlePath = bundle.get();
    

    Keep the Application and the future until the bundle is finished. If you destroy the future before the bundle is finished, the SDK cancels the bundle. If the SDK cannot create the bundle, the call that gets the path throws the error. The builder does not change when you create a bundle, so you can use it again to create a new bundle. To read the progress without a wait, for example from a UI timer, use Experimental::SupportBundle::Progress::latest to get the newest update.

For the full API, see Support Bundle.