Skip to content

outscale/osc-cost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

osc-cost

Project Sandbox

Terminal Icon


๐ŸŒ Links


๐Ÿ“„ Table of Contents


๐Ÿงญ Overview

osc-cost is a command-line utility that estimates current cloud costs for an Outscale account by analyzing live resource states.

It supports multiple output formats and can also export metrics to Prometheus or compare estimated costs against digest-based billing (experimental).


๐Ÿšง Project Status

โš ๏ธ This project is in sandbox status and under active development. Cost estimations are approximations and may differ from official billing. Only official invoices from OUTSCALE are authoritative.


โœ… Requirements

  • An OUTSCALE account with access to the API
  • ~/.osc/config.json for credentials
  • Linux/macOS shell (tested with Bash)
  • Prometheus (optional, for metric export)

๐Ÿ”จ Installation

Download the latest binary from the GitHub Releases page.

Make it executable:

chmod +x osc-cost
mv osc-cost /usr/local/bin/

๐Ÿ›  Configuration

The tool expects credentials in ~/.osc/config.json.

Example config:

{
  "default": {
    "access_key": "YOUR_ACCESS_KEY",
    "secret_key": "YOUR_SECRET_KEY",
    "region": "eu-west-2"
  }
}

To use a different profile, use the --profile flag.


๐Ÿš€ Usage

Estimate costs (default format: human-readable)

osc-cost

Output options

osc-cost --format=human        # human-friendly output
osc-cost --format=markdown     # markdown output
osc-cost --format=json         # detailed structured output
osc-cost --format=ods          # ODS spreadsheet
osc-cost --format=prometheus   # Prometheus format
osc-cost --format=hour         # Only price per hour
osc-cost --format=month        # Only price per month

Skip expensive resources

osc-cost --skip-resource Oos

๐Ÿ“Š Drift Analysis (Beta)

Compare cost estimations with actual usage from digest:

Step 1 โ€“ Export estimation

osc-cost --format=json --output account.json

Step 2 โ€“ Freeze the account for a day

Step 3 โ€“ Compare costs the next day

osc-cost --compute-drift \
  --from-date "$(date -d '-1 day' +%Y-%m-%d)" \
  --to-date "$(date +%Y-%m-%d)" \
  --input account.json

Example output

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Resource Type โ”† Osc-cost โ”† Digest โ”† Drift โ”‚
โ•žโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•ก
โ”‚ Volume        โ”† 1.18     โ”† 1.18   โ”† 0%    โ”‚
โ”‚ Snapshot      โ”† 1.25     โ”† 0.62   โ”† 101%  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿ“ˆ Prometheus Exporter

Export estimated prices in Prometheus format:

osc-cost-exporter --bind 127.0.0.1:8080 &
curl http://127.0.0.1:8080

๐Ÿšข Deployment

With Helm

Use the osc-cost Helm chart for Kubernetes deployment.

With Docker Compose

docker-compose -f helm/docker-compose.yaml up

On Kubernetes (Kind or RKE)

You can deploy with any Kubernetes setup.


๐Ÿค Contributing

We welcome your contributions!

Please read the CONTRIBUTING.md guide.


๐Ÿš€ Release Process

  1. Update Chart.yaml and values.yaml in helm/osccost/
  2. Tag a release:
git tag -a vX.X.X -m "vX.X.X"
  1. Push the tag and publish the release on GitHub.

๐Ÿ“œ License

osc-cost is licensed under the BSD 3-Clause License. ยฉ Outscale SAS This project is compliant with the REUSE Specification

About

Cloud Cost Analysis for OUTSCALE

Topics

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors 6

Languages