ddcost

package module
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 13 Imported by: 0

README

ddcost

test

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

Usage

Usage: ddcost --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).
  -v, --view="summary"        Cost breakdown view (summary, sub-org).
  -o, --output="table"        Formatting style for output (table, tsv, json, csv).
  -s, --start-month=STRING    Cost beginning this month.
  -e, --end-month=STRING      Cost ending this month.
      --estimate              Get estimated cost.
      --version
$ export DD_API_KEY=...
$ export DD_APP_KEY=...
$ ddcost -v sub-org -s 2022-12
       ORG       |       PRODUCT       | CHARGE TYPE | 2022-12 | 2023-01 | 2023-02 | 2023-03 | 2023-04
-----------------+---------------------+-------------+---------+---------+---------+---------+----------
  organization1  | fargate_container   | committed   |       1 |       1 |       1 |       1 |       1
                 |                     | on_demand   |       2 |       2 |       2 |       2 |       2
                 |                     | total       |       3 |       3 |       3 |       3 |       3
                 | logs_indexed_15day  | committed   |       0 |       0 |       0 |       0 |       0
                 |                     | on_demand   |    0.50 |    0.50 |    0.50 |    0.50 |    0.50
                 |                     | total       |    0.50 |    0.50 |    0.50 |    0.50 |    0.50
                 | total               |             |    3.50 |    3.50 |    3.50 |    3.50 |    3.50
                 |                     |             |         |         |         |         |
  organization2  | infra_host          | committed   |      10 |      10 |      10 |      10 |      10
                 |                     | on_demand   |      20 |      20 |      20 |      20 |      20
                 |                     | total       |      30 |      30 |      30 |      30 |      30
                 | logs_indexed_15day  | committed   |       1 |       1 |       1 |       1 |       1
                 |                     | on_demand   |    1.50 |    1.50 |    1.50 |    1.50 |    1.50
                 |                     | total       |    2.50 |    2.50 |    2.50 |    2.50 |    2.50
                 | total               |             |   32.50 |   32.50 |   32.50 |   32.50 |   32.50

Installation

brew install winebarrel/ddcost/ddcost

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) PrintHistoricalCostByOrg

func (client *Client) PrintHistoricalCostByOrg(out io.Writer, options *PrintHistoricalCostByOrgOptions) error

type ClientOptions added in v1.4.0

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 Cost added in v1.0.1

type Cost float64

func (Cost) Float64 added in v1.2.0

func (c Cost) Float64() float64

func (Cost) String added in v1.0.1

func (c Cost) String() string

type CostBreakdown

type CostBreakdown map[string]CostByProduct

org_name/product_name/charge_type/month/cost

type CostByChargeType

type CostByChargeType map[string]CostByMonth

charge_type/month/cost

type CostByMonth

type CostByMonth map[string]Cost

month/cost

type CostByProduct

type CostByProduct map[string]CostByChargeType

product_name/charge_type/month/cost

type PrintHistoricalCostByOrgOptions added in v1.4.0

type PrintHistoricalCostByOrgOptions struct {
	View       string `short:"v" enum:"summary,sub-org" default:"summary" help:"Cost breakdown view (summary, 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:"Cost beginning this month."`
	EndMonth   string `short:"e" help:"Cost ending this month."`
	Estimate   bool   `default:"false" help:"Get estimated cost."`
}

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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