ddusage

package module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2025 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

ddusage

CI

A tool that shows a breakdown of Datadog usages in a table.

Usage

Usage: ddusage --api-key=STRING --app-key=STRING

Flags:
  -h, --help                   Show context-sensitive help.
      --api-key=STRING         Datadog API key ($DD_API_KEY).
      --app-key=STRING         Datadog APP key ($DD_APP_KEY).
  -x, --include-org-details    Include usage summaries for each sub-org..
  -o, --output="table"         Formatting style for output (table, tsv, json, csv).
  -s, --start-month=STRING     Usage beginning this month.
  -e, --end-month=STRING       Usage ending this month.
  -H, --humanize               Convert usage numbers to human-friendly strings.
      --version
$ export DD_API_KEY=...
$ export DD_APP_KEY=...
$ ddusage -x -H
       ORG       |               PRODUCT               | 2022-12 | 2023-01 | 2023-02 | 2023-03 | 2023-04
-----------------+-------------------------------------+---------+---------+---------+---------+----------
  organization1  | apm_host_incl_usm_top99p            | 1       | 1       | 1       | 1       | 1
  organization2  | logs_indexed_logs_usage_sum_15_day  | 1M      | 1M      | 1M      | 1M      | 1M

Installation

brew install winebarrel/ddusage/ddusage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options *ClientOptions) *Client

func (*Client) PrintUsageSummary

func (client *Client) PrintUsageSummary(out io.Writer, options *PrintUsageSummaryOptions) error

type ClientOptions

type ClientOptions struct {
	APIKey string `env:"DD_API_KEY" required:"" help:"Datadog API key."`
	APPKey string `env:"DD_APP_KEY" required:"" help:"Datadog APP key."`
}

type PrintUsageSummaryOptions

type PrintUsageSummaryOptions struct {
	IncludeOrgDetails bool   `short:"x" help:"Include usage summaries for each sub-org.."`
	Output            string `short:"o" enum:"table,tsv,json,csv" default:"table" help:"Formatting style for output (table, tsv, json, csv)."`
	StartMonth        string `short:"s" help:"Usage beginning this month."`
	EndMonth          string `short:"e" help:"Usage ending this month."`
	Humanize          bool   `short:"H" help:"Convert usage numbers to human-friendly strings."`
}

type Usage

type Usage float64

func (Usage) Float64

func (c Usage) Float64() float64

func (Usage) String

func (c Usage) String() string

type UsageBreakdown

type UsageBreakdown map[string]UsageByProduct

org_name/product_name/month/cost

type UsageByMonth

type UsageByMonth map[string]Usage

month/usage

type UsageByProduct

type UsageByProduct map[string]UsageByMonth

product_name/month/usage

Directories

Path Synopsis
cmd
ddusage command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL