Skip to content

Commit

Permalink
Merge pull request #17 from StackVista/STAC-21424-send-sts-time-forma…
Browse files Browse the repository at this point in the history
…t-header

STAC-21424: send timeformat header
  • Loading branch information
fvlankvelt authored Jun 24, 2024
2 parents 140f6c9 + b2d49d0 commit 572199a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions exporter/ststopologyexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func (t *topologyExporter) ConsumeMetrics(ctx context.Context, md pmetric.Metric
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("sts-api-key", apiKey)
req.Header.Add("sts-time-format", "ms")

res, err := t.httpClient.Do(req)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions exporter/ststopologyexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
func TestExporter_pushResourcesData(t *testing.T) {
testServer := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
require.Equal(t, "APIKEY", req.Header[http.CanonicalHeaderKey("sts-api-key")][0])
require.Equal(t, "ms", req.Header[http.CanonicalHeaderKey("sts-time-format")][0])

var payload internal.IntakeTopology
err := json.NewDecoder(req.Body).Decode(&payload)
Expand Down

0 comments on commit 572199a

Please sign in to comment.