Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyTetrahedron committed Nov 15, 2023
1 parent f680ef2 commit f29a69f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ export ACR_ODOO_OAUTH_CLIENT_ID="your_client_id" # see https://docs.central.vshn
export ACR_ODOO_OAUTH_CLIENT_SECRET="your_client_secret"

# Run a query
go run . report --query 'sum by (label) (metric)' --begin "2023-07-08T13:00:00Z" --product-id "your-odoo-product-id" --instance-pattern "instance-%(label)s" --unit-id "your_odoo_unit_id" --timerange 1h --item-desc-pattern "This is a description." --item-group-desc-pattern "Instance %(label)s"
go run . report --query 'sum by (label) (metric)' --begin "2023-07-08T13:00:00Z" --product-id "your-odoo-product-id" --instance-jsonnet 'local labels = std.extVar("labels"); "instance-%(label)s" % labels' --unit-id "your_odoo_unit_id" --timerange 1h --item-description-jsonnet '"This is a description."' --item-group-description-jsonnet 'local labels = std.extVar("labels"); "Instance %(label)s" % labels'

```
```
6 changes: 3 additions & 3 deletions pkg/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ func processSample(ctx context.Context, odooClient OdooClient, args ReportArgs,
instanceStr := ""
err = json.Unmarshal([]byte(instance), &instanceStr)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to interpolate instance template: %w", err)
}

var groupStr string
if args.ItemGroupDescriptionJsonnet != "" {
group, err := vm.EvaluateAnonymousSnippet("group.json", args.ItemGroupDescriptionJsonnet)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to interpolate group description template: %w", err)
}
err = json.Unmarshal([]byte(group), &groupStr)
if err != nil {
Expand All @@ -151,7 +151,7 @@ func processSample(ctx context.Context, odooClient OdooClient, args ReportArgs,
if args.ItemDescriptionJsonnet != "" {
description, err := vm.EvaluateAnonymousSnippet("description.json", args.ItemDescriptionJsonnet)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to interpolate description template: %w", err)
}
err = json.Unmarshal([]byte(description), &descriptionStr)
if err != nil {
Expand Down

0 comments on commit f29a69f

Please sign in to comment.