";let n=document.getElementById("TableOfContents");n&&(n.innerHTML=e)}rerender(){this.rerenderFilterMenu(),this.rerenderPageContent(),this.populateRightNav(),this.runHooks("afterRerender")}rerenderPageContent(){let e={};Object.keys(this.ifFunctionsByRef).forEach(t=>{let s=this.ifFunctionsByRef[t],o=s.value,n=(0,h.reresolveFunctionNode)(s,{variables:this.selectedValsByTraitId});this.ifFunctionsByRef[t]=n,o!==n.value&&(e[t]=n.value)});let t=document.getElementsByClassName("cdoc__toggleable");for(let n=0;n{this.fitCustomizationMenuToScreen()})}addDropdownEventListeners(){let e=document.getElementsByClassName("cdoc-dropdown");for(let t=0;t{let t=e.target;for(;!t.classList.contains("cdoc-dropdown")&&t.parentElement;)t=t.parentElement;let n=t.classList.toggle("cdoc-dropdown__expanded");t.setAttribute("aria-expanded",n.toString())});document.addEventListener("keydown",e=>{if(e.key==="Enter"){let t=e.target;t.classList.contains("cdoc-filter__option")&&t.click()}}),document.addEventListener("click",t=>{for(let n=0;nthis.handleFilterSelectionChange(e));this.addDropdownEventListeners()}locateFilterSelectorEl(){let e=document.getElementById("cdoc-selector");return!!e&&(this.filterSelectorEl=e,!0)}applyFilterSelectionOverrides(){let s=Object.keys(this.selectedValsByTraitId),e=!1,t=this.browserStorage.getTraitVals();Object.keys(t).forEach(n=>{s.includes(n)&&this.selectedValsByTraitId[n]!==t[n]&&(this.selectedValsByTraitId[n]=t[n],e=!0)});let n=(0,j.getTraitValsFromUrl)({url:new URL(window.location.href),traitIds:s});return Object.keys(n).forEach(t=>{this.selectedValsByTraitId[t]!==n[t]&&(this.selectedValsByTraitId[t]=n[t],e=!0)}),e}updateEditButton(){let t=document.getElementsByClassName("toc-edit-btn")[0];if(!t)return;let e=t.getElementsByTagName("a")[0];e&&(e.href=e.href.replace(/\.md\/$/,".mdoc.md/"))}revealPage(){this.runHooks("beforeReveal"),this.filterSelectorEl&&(this.filterSelectorEl.style.position="sticky",this.filterSelectorEl.style.backgroundColor="white",this.filterSelectorEl.style.paddingTop="10px",this.filterSelectorEl.style.visibility="visible",this.filterSelectorEl.style.zIndex="1000");let e=document.getElementById("cdoc-content");e&&(e.style.visibility="visible"),this.runHooks("afterReveal")}rerenderFilterMenu(){if(!this.filterSelectorEl||!this.filtersManifest)throw new Error("Cannot rerender filter selector without filtersManifest and filterSelectorEl");let e=(0,l.resolveFilters)({filtersManifest:this.filtersManifest,valsByTraitId:this.selectedValsByTraitId});Object.keys(e).forEach(t=>{let n=e[t];this.selectedValsByTraitId[t]=n.currentValue});let t=(0,y.buildCustomizationMenuUi)(e);this.filterSelectorEl.innerHTML=t,this.fitCustomizationMenuToScreen(),this.addFilterSelectorEventListeners()}fitCustomizationMenuToScreen(){let e=document.getElementById(g);if(!e)return;let s=e.classList.contains(n),t=document.getElementById(v);if(!t)throw new Error("Dropdown menu not found");let o=document.getElementById(b);if(!o)throw new Error("Menu wrapper not found");let i=e.scrollWidth>o.clientWidth;!s&&i?(e.classList.add(n),t.classList.remove(n)):s&&!i&&(e.classList.remove(n),t.classList.add(n))}get cdocsState(){return{selectedValsByTraitId:this.selectedValsByTraitId,ifFunctionsByRef:this.ifFunctionsByRef,filtersManifest:this.filtersManifest,browserStorage:this.browserStorage,filterSelectorEl:this.filterSelectorEl}}};e.ClientFiltersManager=r,t=r,s={value:void 0}}),y=e(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=j();window.clientFiltersManager=t.ClientFiltersManager.instance}),y()})()Enable Data Jobs Monitoring for Spark on Google Cloud Dataproc
In GCP Secret Manager, open the secret you created. Take note of the Resource ID, which is in the format “projects/<PROJECT_NAME>/secrets/<SECRET_NAME>”.
Make sure the service account used by your Dataproc cluster has permission to read the secret. By default, this is the Compute Engine default service account. To grant access, copy the associated service account Principal, and click Grant Access on the Permissions tab of the secret’s page. Assign the secretmanager.secretAccessor role, or any other one that has secretmanager.versions.access permission. See the IAM roles documentation for a full description of available roles.
When you create a new Dataproc Cluster on Compute Engine in the Google Cloud Console, add an initialization action on the Customize cluster page:
Save the following script to a GCS bucket that your Dataproc cluster can read. Take note of the path to this script.
#!/bin/bash
# Set required parameter DD_SITEexportDD_SITE=datadoghq.com# Set required parameter DD_API_KEY with Datadog API key.# The commands below assumes the API key is stored in GCP Secret Manager, with the secret name as dd_api_key and the project <PROJECT_NAME>.# IMPORTANT: Modify if you choose to manage and retrieve your secret differently.# Change the project name, which you can find on the secrets page. The resource ID is in the format "projects/<PROJECT_NAME>/secrets/<SECRET_NAME>".PROJECT_NAME=<PROJECT_NAME>
gcloud config set project $PROJECT_NAMESECRET_NAME=dd_api_key
exportDD_API_KEY=$(gcloud secrets versions access latest --secret $SECRET_NAME)# Download and run the latest init scriptcurl -L https://install.datadoghq.com/scripts/install-dataproc.sh > djm-install-script; bash djm-install-script ||true
The script above sets the required parameters, and downloads and runs the latest init script for Data Jobs Monitoring in Dataproc. If you want to pin your script to a specific version, you can replace the filename in the URL with install-dataproc-0.12.9.sh to use version 0.12.9, for example. The source code used to generate this script, and the changes between script versions, can be found on the Datadog Agent repository.
Optionally, the script can be configured by adding the following environment variable:
Variable
Description
DD_TAGS
Add tags to Dataproc cluster and Spark performance metrics. Comma or space separated key:value pairs. Follow Datadog tag conventions. Example: env:staging,team:data_engineering
DD_ENV
Set the env environment tag on metrics, traces, and logs from this cluster.
On the Customize cluster page, locate the Initialization Actions section. Enter the path where you saved the script from the previous step.
When your cluster is created, this initialization action installs the Datadog Agent and downloads the Java tracer on each node of the cluster.
Optional: Enable logs collection for your cluster by following the Dataproc integration Log collection setup steps. This correlates application logs to Spark job run traces.
Tagging enables you to better filter, aggregate, and compare your telemetry in Datadog. You can configure tags by passing -Ddd.service, -Ddd.env, -Ddd.version, and -Ddd.tags options to your Spark driver and executor extraJavaOptions properties.
In Datadog, each job’s name corresponds to the value you set for -Ddd.service.