diff --git a/internal/confmap/provider/eecprovider/provider.go b/internal/confmap/provider/eecprovider/provider.go index 7c572231..bc1f6ce7 100644 --- a/internal/confmap/provider/eecprovider/provider.go +++ b/internal/confmap/provider/eecprovider/provider.go @@ -36,7 +36,7 @@ const ( AuthHeaderKey = "Authorization" ApiTokenPrefixFormat = "Api-Token %s" - ConfigRefreshHeaderKey = "X-Otelcol-Config-Refresh" + FirstRequestHeaderKey = "X-Otelcol-First-Request" ConfigChangedHeaderKey = "X-Otelcol-Config-Changed" ) @@ -175,7 +175,7 @@ func (p *provider) Retrieve(ctx context.Context, uri string, watcherFunc confmap if err != nil { return nil, err } - req.Header.Add(ConfigRefreshHeaderKey, "false") + req.Header.Add(FirstRequestHeaderKey, "true") req.Header.Add(ConfigChangedHeaderKey, "false") body, err = p.getConfigBytes(client, req) @@ -211,7 +211,7 @@ func (p *provider) Retrieve(ctx context.Context, uri string, watcherFunc confmap if err != nil { return nil, err } - req.Header.Add(ConfigRefreshHeaderKey, "true") + req.Header.Add(FirstRequestHeaderKey, "false") req.Header.Add(ConfigChangedHeaderKey, configChanged) diff --git a/internal/confmap/provider/eecprovider/provider_test.go b/internal/confmap/provider/eecprovider/provider_test.go index 47d83d0c..c28d7e34 100644 --- a/internal/confmap/provider/eecprovider/provider_test.go +++ b/internal/confmap/provider/eecprovider/provider_test.go @@ -576,7 +576,7 @@ func TestFragmentConfiguration(t *testing.T) { assert.NoError(t, ep.Shutdown(context.Background())) } -func TestConfigRefreshHeader(t *testing.T) { +func TestFirstRequestHeader(t *testing.T) { count := &atomic.Int64{} answerWithConfig := func(w http.ResponseWriter, req *http.Request) { @@ -600,9 +600,9 @@ func TestConfigRefreshHeader(t *testing.T) { } if count.Load() == 0 { - assert.Equal(t, "false", req.Header.Get(ConfigRefreshHeaderKey)) + assert.Equal(t, "true", req.Header.Get(FirstRequestHeaderKey)) } else { - assert.Equal(t, "true", req.Header.Get(ConfigRefreshHeaderKey)) + assert.Equal(t, "false", req.Header.Get(FirstRequestHeaderKey)) } count.Add(1)