Sign in
agent:
Auto Exec

Search and retrieve recent logs from Elasticsearch for specific services containing target keywords.

Trace-based log analysis across microservices or services in Elasticsearch for distributed request tracking using problematic trace_ids from jaeger

List my elasticsearch indices to give me an index pattern name I can search the logs for

Send comprehensive troubleshooting report with root cause and relevant details to Slack channel 'demo'

Perform preliminary infrastructure check by deriving EC2 instance ID from demo app URL, checking instance state, and verifying security group access for port 81

Summarize all recent exceptions and errors for a given set of service or services in jaeger.

Show traces in the last n minutes where service.name in a list of target service/s and (http.target or http.route or url.path contains /path_filter for eg: /api/checkout).

Identify slow or high latency traces for a given service or list of services in jaeger

List all my services in jaeger excludes system related services

Perform preliminary infrastructure check by deriving EC2 instance ID from demo app URL, checking instance state, and verifying security group access for port 81

Fetch the most recent 5 logs from the elasticsearch index <index_name> in last n minutes <lookback_minutes>

Queries Elasticsearch to fetch the latest logs from a list of specified services with required fields

Fetches the latest 10 logs from Elasticsearch for a specific service, sorted by timestamp in descending order

List my elasticsearch indices to give me an index pattern name I can search the logs for

Add a key-value pair

Add credentials for various integrations

What is an "Expert"? How do we create our own expert?

Process Grafana Alerts

Managing workspaces and access control

DagKnows Architecture Overview

Managing Proxies

Setting up SSO via Azure AD for Dagknows

All the experts

Enable "Auto Exec" and "Send Execution Result to LLM" in "Adjust Settings" if desired

(Optionally) Add ubuntu user to docker group and refresh group membership

Deployment of an EKS Cluster with Worker Nodes in AWS

Adding, Deleting, Listing DagKnows Proxy credentials or key-value pairs

Comprehensive AWS Security and Compliance Evaluation Workflow (SOC2 Super Runbook)

AWS EKS Version Update 1.29 to 1.30 via terraform

Instruction to allow WinRM connection

MSP Usecase: User Onboarding Azure + M365

Post a message to a Slack channel

How to debug a kafka cluster and kafka topics?

Docusign Integration Tasks

Open VPN Troubleshooting (Powershell)

Execute a simple task on the proxy

Assign the proxy role to a user

Create roles to access credentials in proxy

Install OpenVPN client on Windows laptop

Setup Kubernetes kubectl and Minikube on Ubuntu 22.04 LTS

Install Prometheus and Grafana on the minikube cluster on EC2 instance in the monitoring namespace

Sample selenium script

update the EKS versions in different clusters

AI agent session 2024-09-12T09:36:14-07:00 by Sarang Dharmapurikar

Install kubernetes on an ec2 instance ubuntu 20.04 using kubeadm and turn this instance into a master node.

Turn an ec2 instance, ubuntu 20.04 into a kubeadm worker node. Install necessary packages and have it join the cluster.

Install Docker

Parse EDN content and give a JSON out

GitHub related tasks

Check whether a user is there on Azure AD and if the user account status is enabled

Searches Jaeger for traces from specified services containing image-related paths in the last n minutes, sorted by duration.

path_filter example: (http.target or http.route or url.path contains /path_filter for eg: /api/checkout).

Limit the result by 5 rows.

Requires inputs: lookback_minutes (int), target_services (array), path_filter (str) and limit (int)

import requests import json from datetime import datetime, timedelta import time filtered_traces = [] trace_count = 0 # Get Jaeger URL from environment jaeger_url = getEnvVar('JAEGER_URL_OTEL') # Calculate time range (last 30 minutes) end_time = datetime.now() start_time = end_time - timedelta(minutes=lookback_minutes) # Convert to microseconds (Jaeger expects microseconds) start_time_us = int(start_time.timestamp() * 1000000) end_time_us = int(end_time.timestamp() * 1000000) print(f"Searching for traces from {start_time} to {end_time}") print(f"Target services: {target_services}") print(f"Path filter: {path_filter}") all_traces = [] # Search traces for each target service for service in target_services: print(f"\nSearching traces for service: {service}") # Construct the traces search URL traces_url = f"{jaeger_url}traces" params = { 'service': service, 'start': start_time_us, 'end': end_time_us, 'limit': 1000 # Get more traces to filter from } try: response = requests.get(traces_url, params=params, timeout=6) response.raise_for_status() traces_data = response.json() if 'data' in traces_data: traces = traces_data['data'] print(f"Found {len(traces)} traces for {service}") # Filter traces that contain the path filter in http fields for trace in traces: if 'spans' in trace: for span in trace['spans']: if 'tags' in span: # Check for http.target, http.route, or url.path containing /image http_fields = ['http.target', 'http.route', 'url.path'] path_found = False for tag in span['tags']: if tag.get('key') in http_fields: if path_filter in str(tag.get('value', '')): path_found = True break if path_found: # Calculate total trace duration trace_duration = 0 if trace['spans']: min_start = min(span.get('startTime', 0) for span in trace['spans']) max_end = max(span.get('startTime', 0) + span.get('duration', 0) for span in trace['spans']) trace_duration = max_end - min_start trace_info = { 'traceID': trace.get('traceID'), 'service': service, 'duration_us': trace_duration, 'duration_ms': round(trace_duration / 1000, 2), 'spans_count': len(trace['spans']), 'start_time': datetime.fromtimestamp(min_start / 1000000).isoformat() if trace['spans'] else None } # Find the operation name from root span root_spans = [s for s in trace['spans'] if not s.get('references')] if root_spans: trace_info['operation'] = root_spans[0].get('operationName', 'unknown') else: trace_info['operation'] = trace['spans'][0].get('operationName', 'unknown') all_traces.append(trace_info) break # Found matching span, no need to check other spans in this trace except requests.exceptions.RequestException as e: print(f"Error fetching traces for {service}: {e}") except Exception as e: print(f"Error processing traces for {service}: {e}") # Sort traces by duration descending all_traces.sort(key=lambda x: x['duration_us'], reverse=True) # Limit to top 50 filtered_traces = all_traces[:limit] trace_count = len(filtered_traces) print(f"\nFound {trace_count} traces matching criteria:") for i, trace in enumerate(filtered_traces[:10], 1): # Show first 10 for preview print(f"{i}. TraceID: {trace['traceID'][:16]}... | Service: {trace['service']} | Operation: {trace['operation']} | Duration: {trace['duration_ms']}ms") if trace_count > 10: print(f"... and {trace_count - 10} more traces") print(f"\nOutput Parameters:") print(f"filtered_traces: {json.dumps(filtered_traces, indent=2)}") print(f"trace_count: {trace_count}")
copied