Skip to content

Commit

Permalink
feat(BRIDGE-122): added observability request and types to GPA
Browse files Browse the repository at this point in the history
feat(BRIDGE-122): added priority
  • Loading branch information
ElectroNafta committed Aug 22, 2024
1 parent 218840f commit f61d9b4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
13 changes: 13 additions & 0 deletions observability.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package proton

import (
"context"

"github.com/go-resty/resty/v2"
)

func (c *Client) SendObservabilityBatch(ctx context.Context, req ObservabilityBatch) error {
return c.do(ctx, func(r *resty.Request) (*resty.Response, error) {
return r.SetHeader("Priority", "u=6").SetBody(req).Post("/data/v1/metrics")
})
}
14 changes: 14 additions & 0 deletions observability_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package proton

import "time"

type ObservabilityBatch struct {
Metrics []ObservabilityMetric `json:"Metrics"`
}

type ObservabilityMetric struct {
Name string `json:"Name"`
Version int `json:"Version"`
Timestamp time.Time `json:"Timestamp"`
Data interface{} `json:"Data"`
}

0 comments on commit f61d9b4

Please sign in to comment.