Skip to main content

Monte Carlo and the data.world Collector

Note

The latest version of the Collector is 2.138. To view the release notes for this version and all previous versions, please go here.

About the collector

The Monte Carlo collector harvests resources from your Monte Carlo environment such as Monitors and Incidents, and the tables associated with the Monitors and Incidents.

Authentication supported

  • The Monte Carlo collector authenticates to Monte Carlo using API key.

What is cataloged

The collector catalogs the following information.

Table 1.

Object

Information cataloged

Monitor

Name (Monitor Description or UUID), Description, Created Time, Monitor Status Type, External link, Paused State, Snoozable state, Snoozed state, Is Template Managed, Monitor type, Description, Schedule type, User the monitor was created by

Incident

Title, Incident ID, Incident Time, External Link, Incident Feedback, Incident Reaction Type, Owner Email, Severity, Incident type and sub-types

Table

External Link, Incidents by Status Summary, Incidents Under Investigation Summary, Monitors Summary, Table ID, Schema and database that tables belong to



Relationships between objects

By default, the harvested metadata includes catalog pages for the following resource types. Each catalog page has a relationship to the other related resource types. If the metadata presentation for this data source has been customized with the help of the data.world Solutions team, you may see other resource pages and relationships.

Table 2.

Resource page

Relationship

Table

Incident that occurred on the table

Incident

Table that Incident occurred on

Monitor

Table that is monitored



Generating a Monte Carlo API key

Important

You will need to set up an API key for your user to connect to Monte Carlo. The collector will harvest resources from the domains that your user has access to. We recommend that you use service account keys.

To generate a Monte Carlo API key:

  1. Log in to your Monte Carlo instance.

  2. From the top navigation, click Settings.

  3. From the left navigation, click on API.

  4. Click Create Key.

  5. Assign a description and set an expiration.

  6. Click Create.

    Generate_Monte_Carlo_key.png

Setting up pre-requisites for running the collector

Make sure that the machine from where you are running the collector meets the following hardware and software requirements.

Table 1.

Item

Requirement

Hardware

RAM

8 GB

CPU

2 Ghz processor

Software

Docker

Click here to get Docker.

Java Runtime Environment

OpenJDK 17 is supported and available here.

data.world specific objects

Dataset

You must have a ddw-catalogs (or other) dataset set up to hold your catalog files when you are done running the collector.



Generating the command or YAML file

This section walks you through the process of generating the command or YAML file for running the collector from Windows or Linux or MAC OS.

To generate the command or YAML file:

  1. On the Organization profile page, go to the Settings tab > Metadata collectors section.

  2. Click the Help me set up a collector button.

  3. On the On-prem collector setup prerequisites screen, read the pre-requisites and click Next.

  4. On the On which platform will this collector execute? screen, select if you will be running the collector on Windows or Mac OS or Linux. This will determine the format of the YAML and CLI that is generated in the end. Click Next.

    general_01.png
  5. On the Choose metadata collector type you would like to setup screen, select Monte Carlo. Click Next.

  6. On the Configure a new on premises Monte Carlo Collector screen, set the following properties and click Next.

    monte_carlo_01.png
  7. On the next screen, set the following properties and click Next.

    monte_carlo_02.png
    Table 3.

    Field name

    Corresponding parameter name

    Description

    Required?

    Monte Carlo API URL

    --montecarlo-api-endpoint=<endpoint>

    Base URL of the Monte Carlo API.

    Yes

    The Monte Carlo API Key ID

    --montecarlo-api-key-id=<keyID>

    Monte Carlo key id provided when creating API key.

    Yes

    The Monte Carlo secret

    --montecarlo-api-secret=<secret>

    Monte Carlo secret provided when creating API key.

    Yes



  8. On the Finalize your Monte Carlo Collector configuration screen, you are notified about the environment variables and directories you need to setup for running the collector. Select if you want to generate a Configuration file( YAML) or Command line arguments (CLI). Click Next.

    monte_carlo_03.png
  9. The next screen gives you an option to download the YAML configuration file or copy the CLI command. Click Done. If you are generating a YAML file, click Next.

    monte_carlo_04.png

    Sample YAML file.

    monte_carlo_05.png
  10. The Monte carlo command screen gives you the command to use for running the collector using the YAML file.

    monte_carlo_06.png
  11. You will notice that the YAML/CLI has following additional parameters that are automatically set for you.

    Important

    Except for the collector version, you should not change the values of any of the parameter listed here.

    Table 4.

    Parameter name

    Details

    Required?

    -a= <agent>

    --agent= <agent>

    --account= <agent>

    The ID for the data.world account into which you will load this catalog - this is used to generate the namespace for any URIs generated.

    Yes

    --site= <site>

    This parameter should be set only for Private instances. Do not set it for public instances and single-tenant installations. Required for private instance installations.

    Yes

    (required for private instance installations)

    -U

    --upload

    Whether to upload the generated catalog to the organization account's catalogs dataset.

    Yes

    -L

    --no-log-upload

    Do not upload the log of the Collector run to the organization account's catalogs dataset.

    Yes

    dwcc: <CollectorVersion>

    The version of the collector you want to use (For example, datadotworld/dwcc:2.113)

    Yes



  12. You can add the following parameters to the Command or YAML file to use these additional features.

    Table 5.

    Parameter name

    Description

    Required?

    --montecarlo-graphql-page-size=<pageSize>

    Set the page size for Monte Carlo graphql queries which support pagination.

    Default is 5000.

    No

    --montecarlo-incident-lookback-days=<incidentLookbackDays>

    Number of days in the past to harvest incidents from. If not specified, all incidents are harvested.

    No

    –-montecarlo-domain=<domainNames>

    The name of the Monte Carlo domain to catalog resources from.

    No



Verifying environment variables and directories

  1. Verify that you have set up all the required environment variables that were identified by the Collector Wizard before running the collector. Alternatively, you can set these credentials in a credential vault and use a script to retrieve those credentials.

  2. Verify that you have set up all the required directories that were identified by the Collector Wizard.

Running the collector

Important

Before you begin running the collector make sure you have the correct version of collectors downloaded and available.

Running collector using YAML file

  1. Go to the server where you have setup docker to run the collector.

  2. Make sure you have download the correct version of collectors. This version should match the version of the collector specified in the command you are using to run the collector.

  3. Place the YAML file generated from the Collector wizard to the correct directory.

  4. From the command line, run the command generated from the application for executing the YAML file.

    Caution

    Note that is just a sample command for showing the syntax. You must generate the command specific to your setup from the application UI.

    docker run -it --rm --mount type=bind,source=${HOME}/dwcc,target=/dwcc-output \
      --mount type=bind,source=${HOME}/dwcc,target=${HOME}/dwcc --mount type=bind,source=${HOME}/dwcc-drivers,target=/usr/src/dwcc-config/lib \
      -e DW_AUTH_TOKEN=${DW_AUTH_TOKEN} -e DW_MONTE_CARLO_SECRET=${DW_MONTE_CARLO_SECRET} \
      datadotworld/dwcc:2.124 --config-file=/dwcc-output/config-monte_carlo.yml
  5. The collector automatically uploads the file to the specified dataset and you can also find the output at the location you specified while running the collector.

  6. At a later point, if you download a newer version of collector from Docker, you can edit the collector version in the generated command to run the collector with the newer version.

Running collector without the YAML file

  1. Go to the server where you have setup docker to run the collector.

  2. Make sure you have download the version of collectors from here. This version should match the version of the collector specified in the command you are using to run the collector.

  3. From the command line, run the command generated from the application. Here is a sample command.

    Caution

    Note that is just a sample command for showing the syntax. You must generate the command specific to your setup from the application UI.

    docker run -it --rm --mount type=bind,source=${HOME}/dwcc,target=/dwcc-output \
      --mount type=bind,source=${HOME}/dwcc,target=${HOME}/dwcc --mount type=bind,source=${HOME}/dwcc-drivers,target=/usr/src/dwcc-config/lib \
      datadotworld/dwcc:2.124 catalog-montecarlo --agent=8bank-catalog-sources \
      --site=solutions --no-log-upload=false --upload=true --api-token=${DW_AUTH_TOKEN} \
      --name=8bank-catalog-sources-collection --output=/dwcc-output \
      --upload-location=ddw-catalogs --montecarlo-api-endpoint=https://api.getmontecarlo.com/graphql \
      --montecarlo-api-key-id=4023i444 --montecarlo-api-secret=${DW_MONTE_CARLO_SECRET}
  4. The collector automatically uploads the file to the specified dataset and you can also find the output at the location you specified while running the collector.

  5. At a later point, if you download a newer version of collector from Docker, you can edit the collector version in the generated command to run the collector with the newer version.

Common troubleshooting tasks

Collector runtime and troubleshooting

The catalog collector may run in several seconds to many minutes depending on the size and complexity of the system being crawled. If the catalog collector runs without issues, you should see no output on the terminal, but a new file that matching *.dwec.ttl should be in the directory you specified for the output. If there was an issue connecting or running the catalog collector, there will be either a stack trace or a *.log file. Both of those can be sent to support to investigate if the errors are not clear. A list of common issues and problems encountered when running the collectors is available here.

Issue 1: Resources from certain domains not getting cataloged

  • Cause: This issue generally happens when the Monte Carlo user associated with the API key that the collector uses to authenticate to Monte Carlo does not have permissions to a certain domain.

  • Solution: Ensure the user has access to the specific domains.

Issue 2: The collector may not complete successfully

  • Cause: Large deployments of Monte Carlo may result in API timeouts.

  • Solution: Lower page size for the parameter --montecarlo-graphql-page-size. The default is 250. Alternatively, adjust the --montecarlo-incident-lookback-days parameter to reduce the number of cataloged incidents.

Automating updates to your metadata catalog

Keep your metadata catalog up to date using cron, your Docker container, or your automation tool of choice to run the catalog collector on a regular basis. Considerations for how often to schedule include:

  • Frequency of changes to the schema

  • Business criticality of up-to-date data

For organizations with schemas that change often and where surfacing the latest data is business critical, daily may be appropriate. For those with schemas that do not change often and which are less critical, weekly or even monthly may make sense. Consult your data.world representative for more tailored recommendations on how best to optimize your catalog collector processes.