Gtrace - Unofficial, simple yet effective Google Cloud Trace CLI tool


License: MIT PkgGoDev Go Report Card

Unofficial, simple yet effective Google Cloud Trace CLI tool.



Installation

Homebrew (Linux/macOS)

brew install moshebe/pkg/gtrace

Go (Linux/Windows/macOS/any other platform supported by Go)

If you have Go 1.16+, you can install latest released version of gtrace directly from source by running:

go install github.com/moshebe/gtrace@latest

Usage

› gtrace help
NAME:
   gtrace - Google Cloud Trace CLI tool

USAGE:
   Simple command-line tool for query and fetch tracing information from Cloud Trace API.
   Find more information at: https://cloud.google.com/trace/docs

VERSION:
   v1.0.0

COMMANDS:
   get      Get a specific trace by id from one or more projects
   list     Query traces from a project according to the given conditions
   url      Generate a browsable URL for a given trace
   format   Format trace spans according to a given template
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help (default: false)
   --version, -v  print the version (default: false)

Authentication

Google Cloud APIs has a few methods to authenticate:

  1. On your machine maka sure you have gcloud and that you are logged-in and then run gcloud auth application-default login
  2. If you are running on GKE you can use Workload Identity
  3. Service accounts with JSON keys
  4. Pointing to your service account via env GOOGLE_APPLICATION_CREDENTIALS

You can read about it more on: https://cloud.google.com/docs/authentication/getting-started

Examples

Fetch a specific trace from multiple projects:

gtrace get --project production-a,production-b 5e26a889fa12da351beee9ea16ce0a65

Format trace spans by a specific template:

gtrace format -f /tmp/trace.json --template "{{ .Name }}, {{ .Duration }}"

Query traces by multiple filters from the last 3 hours:

gtrace list --project dev --limit 10 --since 3h --filter service:api --filter user-id:1234
Owner
Moshe Beladev
Engineering @ torqio
Moshe Beladev
Similar Resources

This is simple repositry use to detect which port is open. It is a custom tool built in GO LANG.

dynamic-port-scanning-in-GO-lang This is simple repositry use to detect which port is open. It is a custom tool built in GO LANG. This is CUSTOM tool

Jan 25, 2022

2FA (Two-Factor Authentication) application for CLI terminal with support to import/export andOTP files.

2FA (Two-Factor Authentication) application for CLI terminal with support to import/export andOTP files.

zauth zauth is a 2FA (Two-Factor Authentication) application for terminal written in Go. Features Supports both TOTP and HOTP codes. Add new entries d

Nov 27, 2022

Doctl: A command-line interface (CLI) for the DigitalOcean API

doctl doctl is a command-line interface (CLI) for the DigitalOcean API. Usage:

Feb 16, 2022

CLI client (and Golang module) for deps.dev API. Free access to dependencies, licenses, advisories, and other critical health and security signals for open source package versions.

CLI client (and Golang module) for deps.dev API. Free access to dependencies, licenses, advisories, and other critical health and security signals for open source package versions.

depsdev CLI client (and Golang module) for deps.dev API. Free access to dependencies, licenses, advisories, and other critical health and security sig

May 11, 2023

:lock: acmetool, an automatic certificate acquisition tool for ACME (Let's Encrypt)

:lock: acmetool, an automatic certificate acquisition tool for ACME (Let's Encrypt)

acmetool is an easy-to-use command line tool for automatically acquiring certificates from ACME servers (such as Let's Encrypt). Designed to flexibly

Dec 29, 2022

DirDar is a tool that searches for (403-Forbidden) directories to break it and get dir listing on it

DirDar is a tool that searches for (403-Forbidden) directories to break it and get dir listing on it

DirDar v1.0 Description 🏴‍☠️ bypass forbidden directories - find and identify dir listing - you can use it as directory brute-forcer as well Compatab

Jan 1, 2023

SSRFuzz is a tool to find Server Side Request Forgery vulnerabilities, with CRLF chaining capabilities

SSRFuzz is a tool to find Server Side Request Forgery vulnerabilities, with CRLF chaining capabilities Why?

Dec 8, 2022

A fast tool to mass scan for a vulnerability on Microsoft Exchange Server that allows an attacker bypassing the authentication and impersonating as the admin (CVE-2021-26855).

A fast tool to mass scan for a vulnerability on Microsoft Exchange Server that allows an attacker bypassing the authentication and impersonating as the admin (CVE-2021-26855).

proxylogscan This tool to mass scan for a vulnerability on Microsoft Exchange Server that allows an attacker bypassing the authentication and imperson

Dec 26, 2022

A scalable overlay networking tool with a focus on performance, simplicity and security

What is Nebula? Nebula is a scalable overlay networking tool with a focus on performance, simplicity and security. It lets you seamlessly connect comp

Dec 29, 2022
Comments
  • CLI design

    CLI design

    Tech:

    • stdlib? maybe https://github.com/urfave/cli?
    • store config?

    Features we may think about:

    • control project from command line (like in gcloud --project)
    • set default project (use by default the gcloud project id or override it only for our tool?)
    • exclude/include spans (whitelist/blacklist) - by regex
    • exclude/include labels (whitelist/blacklist) - by regex
    • sources: fetch trace from GCP: by trace id, search by filters
      • (enable pre-created filters for example: if I want to search for bla-id instead of passing LABEL:bla-id:1234 I'd like to create a custom filter for bla-id and just find it by: gtrace get bla 1234 (maybe we can hold per such a filter the exclude/include spans etc.)
    • Destinations: stdout, file (/tmp or given path?)
  • [Informational] Use case for gtrace CLI

    [Informational] Use case for gtrace CLI

    This is pretty neat! I'm the PM for Google Cloud Trace and I'm curious about your use case(s) for this CLI. When do you use this CLI as opposed to using the Google Cloud Console web UI for Cloud Trace?

    I suspect the ease of being able to use cmd line tools like grep, sed, etc on a terminal is the main motivation but wanted to confirm.

  • README

    README

    • Motivation for the project
    • Authentication (auto-detect GCP credentials / supply base64 decoded credentials env)
    • Installation / Building from source
    • Usage example
    • Contribution Guideline

    Bonus: nice logo 😄

  • Add duration and subtree commands

    Add duration and subtree commands

    Add two new commands:

    1. duration - calculates spans durations and allow easy filter & sort to pinpoint latency issues on a specific trace
    2. subtree - extract a specific span and all of its children from a trace in order to easily inspect issues within big traces
Related tags
Yet another log4j vulnerability scanner

k-amon-k - Yet another log4j scanner Quick-n-Dirty installation Assuming you hav

Oct 12, 2022
Cloud IP address ranges lookup tool + DNS subdomain enumeration + Certificate Transparency
Cloud IP address ranges lookup tool + DNS subdomain enumeration + Certificate Transparency

Cloud edge Lookup an IP to find the cloud provider and other details based on the provider's published JSON data Cloud edge is a recon tool focused on

Dec 12, 2022
WhiteSource Log4j Detect is a free CLI tool that quickly scans your projects to find vulnerable Log4j versions

Log4jDetect WhiteSource Log4j Detect is a free CLI tool that quickly scans your projects to find vulnerable Log4j versions containing the following kn

Nov 20, 2022
A CLI tool that can be used to disrupt wireless connectivity in your area by jamming all the wireless devices connected to multiple access points.

sig-716i A CLI tool written in Go that can be used to disrupt wireless connectivity in the area accessible to your wireless interface. This tool scans

Oct 14, 2022
Simple CLI to generate passwords

pwdrng Simple CLI to generate passwords $ pwdrng Copied password to clipboard: bfx861[X<26-b^UT Installation and Usage With Homebrew $ brew tap docto

Apr 8, 2022
Carbon Black Harbor Adapter is a scanner to scan images in Harbor Registry with the help of Carbon Black Cloud.
Carbon Black Harbor Adapter is a scanner to scan images in Harbor Registry with the help of Carbon Black Cloud.

carbon-black-adapter-for-harbor Overview Carbon Black adapter for Harbor integrates your Harbor Registry with the Carbon Black Cloud. It leverages Har

Nov 1, 2022
A Declarative Cloud Firewall Reverse Proxy Solution with Companion Mobile App
A Declarative Cloud Firewall Reverse Proxy Solution with Companion Mobile App

A declarative Cloud firewall reverse proxy solution with inbuilt DDoS protection and alerting mechanism to protect your servers and keeping an eye on those malicious requests

Aug 10, 2022
Crane: Cloud Resource Analytics and Economics
Crane: Cloud Resource Analytics and Economics

Crane: Cloud Resource Analytics and Economics Crane: Cloud Resource Analytics an

Dec 27, 2021
A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

age age is a simple, modern and secure file encryption tool, format, and library. It features small explicit keys, no config options, and UNIX-style c

Dec 28, 2022
Community edition nuclei templates, a simple tool that allows you to organize all the Nuclei templates offered by the community in one place

cent Community edition nuclei templates, a simple tool that allows you to organize all the Nuclei templates offered by the community in one place Inst

Jan 9, 2023