> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Customize Job result views

Domino offers a solution for capturing and visualizing Job metrics. While it’s recommended to use Domino’s MLflow implementation for this purpose, using Domino directly remains a popular choice. Users have the flexibility to log metrics in both places if they prefer.

1. Click **Jobs** from the Project menu.

2. Click the funnel icon above the table of Jobs to customize the columns in the Jobs dashboard.

## Add new columns to the Jobs dashboard with dominostats.json

To include metrics in the Jobs dashboard that Domino doesn’t provide by default, you can define custom columns. This can be done by using the `dominostats.json` file, letting you tailor the dashboard to better understand and analyze your Job performance.

1. Write a file named `dominostats.json` to the root of your project directory.

2. Use keys in `dominostats.json` to identify the outputs you’re interested in and add the corresponding values.

3. If Domino detects that `dominostats.json` has been written to the Project root by a Job, it parses the values and shows them as columns on the [Jobs dashboard](/cloud/platform-capabilities/core-concepts/jobs).

<Note>
  Domino automatically deletes `dominostats.json` before each execution.
</Note>

The following is sample R code that writes three key/value pairs to `dominostats.json`:

```r theme={null}
diagnostics = list("R^2" = 0.99, "p-value" = 0.05, "sse" = 10.49)
library(jsonlite)
fileConn<-file("dominostats.json")
writeLines(toJSON(diagnostics), fileConn)
close(fileConn)
```

The following is the same data written to `dominostats.json` in Python:

```python theme={null}
import json
with open('dominostats.json', 'w') as f:
    f.write(json.dumps({"R^2": 0.99, "p-value": 0.05, "sse": 10.49}))
```

The resulting `dominostats.json` from these code examples looks like this:

```json theme={null}
{
  "sse": 10.49,
  "R^2": 0.99,
  "p-value": 0.05
}
```

## Use .dominoresults and .dominoignore to render specific files in the Jobs dashboard

Use the `.dominoresults` and `.dominoignore` files to control which files Domino renders in the Jobs results view. This can be useful to limit your results if many files are changed in your execution, or to exclude unnecessary log files generated during the execution.

<Tip>
  R language exceptions can be especially large, which can impact sync times. So you may want to exclude the R debug outputs, depending on your use cases.
</Tip>

### Include or exclude single files in the results dashboard

To include or exclude only specific files, your `.dominoresults` or `.dominoignore` file must list the relative path to those, each on a new line. The following example will exclude or include `histogram.pdf` and `output.txt` in the top-level directory of the Project.

```shell theme={null}
histogram.pdf
output.txt
```

### Use patterns with wildcard characters

Domino can use wildcard patterns in `.dominoresults` and `.dominoignore`. This way you can specify groups of files to show. The following example limits the files to PDF documents in the top-level directory, all PNG files in a directory images and text files arbitrarily deep in sub-directories of the Project.

```shell theme={null}
*.pdf
results/*.png
**/*.txt
```

### Configure Job result views

Run results can also be configured to control things like the maximum number of files Domino renders for comparisons and diffs.

For more information, please reach out to Domino Support.

## View custom metrics as a time series over time

You can see how your custom keys change over time.

1. Click **Jobs Timeline** to expand a line chart of `dominostats.json` values over time.

   This chart shows all Jobs listed in the current dashboard. To filter to a specific set of related Jobs, [tag](/cloud/platform-capabilities/core-concepts/jobs) the Jobs to create a separate dashboard view.

The x-axis ticks on the timeline represent individual Jobs, and the y-axis represents the values for the statistics in those Jobs.

1. Hold your cursor over the chart to see individual data points as tooltips.

2. Click on a point to open the details for the Job that produced that value.

3. Click and drag on the chart to zoom in.

4. Click each stat in the legend to toggle its line on and off.

## Email notifications

By default, Domino notifies you by email about *failed* Project executions. You and your Project collaborators can also receive notifications about *successful* executions.

On successful executions, you will receive an email with the last few lines of `stdout`, and up to ten results files from your execution. Domino detects which files were added or changed during your execution, and captures those as the execution’s results.

### Edit notification preferences

1. In the navigation pane, click **Projects**.

2. Go to your Project and click **Settings**.

3. Click **Access and Sharing** and go to **Collaborations and permissions**.

4. Set the **Notifications preference** for users.

## Send custom Emails

You can create fully customizable Job email notifications with any formatting and results you want.

For [Domino File System (DFS) projects](/cloud/platform-capabilities/core-concepts/projects/manage-dfs-projects), create a file named `email.html` in the *root of your project folder* as part of your run.

For [Git-based projects](/cloud/platform-capabilities/core-concepts/projects/manage-git-projects), create a file named `email.html` in the `/mnt/artifacts/` directory as part of your run.

The HTML in `email.html` can be used as the body and subject of the email sent on success.

### Tips and tricks

* To include images, reference the path to the image from the root of the folder. The image can be anywhere in your Project. For example, to include an image in `plots/plot1.png`, write `<img src="plots/plot1.png">`.

* Put all CSS styles in inline `style` attributes. Most email clients ignore `<style>` blocks in HTML emails.

* You can render a Jupyter Notebook to HTML and name it `emails.html` to send notebooks.

* Use tables for complex layouts. Most email clients ignore CSS positioning.

* Include the `<head>` and `<title>` tags at the start of the HTML file to customize the subject. For example: `<head><title>Custom Subject</title></head>` creates an email with the subject "\[Domino] Custom Subject".

* To explicitly define the files that are sent with your success email, create a file named `.dominoresults` and write a filename per line in the `.dominoresults` file.

  <Warning>
    If you create a `.dominoresults` file, you must list `email.html` in this file to ensure that your custom email is used. If you don’t, the default results email will be generated.
  </Warning>

* For Git-based projects, write Job results to the `/mnt/artifacts/results/` directory. This allows the files to be included as attachments to the email and appear as results in the Job UI. See [Save Artifacts to the Domino File System](/cloud/platform-capabilities/core-concepts/projects/manage-git-projects/work-with-git#save-artifacts-to-the-domino-file-system) for more info.

<Tabs>
  <Tab title="R">
    Example of an R script and the resulting email:

    ```r theme={null}
    # generate and save plot
    png("pressure.png")
    plot(pressure)
    dev.off()

    # generate HTML in a string
    html_string <- paste0("
    <head>
      <title>",Sys.Date()," - Pressure report","</title>
    </head>
    <body>
      <h2>Exponential pressure growth! </h2>
      <h3>",Sys.time(),"</h3>
      <img src='pressure.png' />
      <p>Caption goes here</p>
    </body>
    ")

    # write string to file
    write(html_string, "email.html")
    ```
  </Tab>

  <Tab title="Python">
    Example of a Python script:

    ```python theme={null}
    import matplotlib.pyplot as plt
    import numpy as np
    x = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8])
    y = np.array([495, 620, 761.88, 899.8, 1039.93, 1270.63, 1589.04, 1851.31, 2154.92])
    plt.axis([0, 8, 0, 2200])
    plt.xlabel('year')
    plt.ylabel('balance')
    plt.plot(x, y)
    plt.savefig('results/plot.png')
    email_content = """
    <head>
      <title>Latest projections</title>
    </head>
    <body>
      <h1>Latest projections</h1>
      <div>
          <img src="results/plot.png">
      </div>
    </body>
    """
    f = open('email.html', 'w')
    f.write(email_content)
    f.close()
    ```
  </Tab>
</Tabs>
