Skip to content

Instantly share code, notes, and snippets.

View jaycdave88's full-sized avatar

Jay C. Davé jaycdave88

View GitHub Profile
custom_metrics:
- name: sqlserver.buffer.page_lookups
counter_name: Page lookups/sec
- name: sqlserver.buffer.page_reads
counter_name: Page reads/sec
- name: sqlserver.workload.queued_requests
counter_name: Queued Requests
@jaycdave88
jaycdave88 / Datadog_AspNetCore_APM_CMD_Batch.cmd
Last active November 4, 2020 20:19
Run Windows Desktop application script
rem Set environment variables
SET CORECLR_ENABLE_PROFILING=1
SET CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
SET CORECLR_PROFILER_PATH=%PROGRAMFILES%\Datadog\.NET Tracer\Datadog.Trace.ClrProfiler.Native.dll
SET DD_INTEGRATIONS=%PROGRAMFILES%\Datadog\.NET Tracer\integrations.json
SET DD_DOTNET_TRACER_HOME=%PROGRAMFILES%\Datadog\.NET Tracer
rem Start application
dotnet.exe example.dll
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: basket
spec:
paused: true
template:
metadata:
labels:
app: eshop
@RequestMapping
public @ResponseBody String coffeeHouseIndex() {
if (GlobalTracer.get() != null && GlobalTracer.get().activeSpan() != null) {
try {
GlobalTracer.get().activeSpan();
if (setPriority.get() == null) {
setPriority.compareAndSet(null, GlobalTracer.get().activeSpan().getClass().getDeclaredMethod("setSamplingPriority", int.class));
}
setPriority.get().invoke(GlobalTracer.get().activeSpan(), 2 );
} catch(Exception e) {
image:
repository: datadog/agent
tag: latest
pullPolicy: IfNotPresent
nameOverride: ""
fullnameOverride: ""
datadog:
apiKey: xxx
appKey: xxx
name: datadog
$TRACE_ID=($RANDOM % 1000000)
$SPAN_ID=($RANDOM % 1000000)
$START=$(date +%s%N)
sleep 2
$DURATION=$(($(date +%s%N) - $START))
$headers = @{"Content-Type" = "application/json"}
$url = "http://localhost:8126/v0.3/traces"
$parm = @{"trace_id"=$TRACE_ID; "span_id"=$SPAN_ID; "name"='azuretest'; "resource"='/home'; "service"='none';
"type"='web'; "start"=$START; "duration"=$DURATION }
@jaycdave88
jaycdave88 / win_docker.py
Last active May 20, 2019 22:29
Docker Windows Health - Agent Check
from checks import AgentCheck
from datetime import tzinfo, timedelta
import datetime
import requests
import json
import calendar
class UTC(tzinfo):
def utcoffset(self, dt):
return timedelta(0)
- hosts: windows
tasks:
- name: get dotnet tracer
win_get_url:
url: 'https://github.com/DataDog/dd-trace-dotnet/releases/download/v1.1.0/DatadogDotNetTracing-1.1.0-x64.msi'
dest: 'C:\datadog_dotnet_v1.1.0.msi'
- name: install datadog tracer msi file
win_msi:
$url = "https://notepad-plus-plus.org/repository/7.x/7.6.6/npp.7.6.6.Installer.exe"
$outpath = "C:/notepad++.exe"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $outpath)
$args = @("Comma","Separated","Arguments")
Start-Process -Filepath "C:/notepad++.exe" -ArgumentList $args
@jaycdave88
jaycdave88 / centos7_ansible.sh
Created April 8, 2019 18:04 — forked from ncracker/centos7_ansible.sh
Setting up Ansible control machine - targets are going to be Windows hosts
#!/bin/bash
# Set up CentOS to act as an Ansible controller
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# ensure CentOS all up-to-date
yum update -y
# epel is to be used for pip
yum install epel-release -y