Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HCP Telemetry] Periodic Refresh for Dynamic Telemetry Configuration #18168

Merged
merged 42 commits into from
Aug 1, 2023
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
00cee32
OTElExporter now uses an EndpointProvider to discover the endpoint
Achooo Jul 18, 2023
77f09b8
OTELSink uses a ConfigProvider to obtain filters and labels configura…
Achooo Jul 18, 2023
ff4d85f
improve tests for otel_sink
Achooo Jul 18, 2023
0264d5b
Regex logic is moved into client for a method on the TelemetryConfig …
Achooo Jul 18, 2023
f12219a
Create a telemetry_config_provider and update deps to use it
Achooo Jul 18, 2023
8b4bf1d
Fix conversion
Achooo Jul 18, 2023
5b4c997
fix import newline
Achooo Jul 18, 2023
7550818
Add logger to hcp client and move telemetry_config out of the client.…
Achooo Jul 25, 2023
3f1c53d
Add a telemetry_config.go to refactor client.go
Achooo Jul 25, 2023
8dce916
Update deps
Achooo Jul 25, 2023
2313673
update hcp deps test
Achooo Jul 25, 2023
196a4ef
Modify telemetry_config_providers
Achooo Jul 25, 2023
3b031a2
Check for nil filters
Achooo Jul 25, 2023
cb869b1
PR review updates
Achooo Jul 26, 2023
38d6bca
Fix comments and move around pieces
Achooo Jul 26, 2023
1feea25
Fix comments
Achooo Jul 26, 2023
0d25ba4
Remove context from client struct
Achooo Jul 26, 2023
a58baa7
Moved ctx out of sink struct and fixed filters, added a test
Achooo Jul 26, 2023
f3be3ec
Remove named imports, use errors.New if not fformatting
Achooo Jul 26, 2023
a353527
Remove HCP dependencies in telemetry package
Achooo Jul 26, 2023
de55bf9
Add success metric and move lock only to grab the t.cfgHahs
Achooo Jul 26, 2023
eacf20e
Update hash
Achooo Jul 27, 2023
4ed2b74
fix nits
Achooo Jul 27, 2023
e3839b3
Create an equals method and add tests
Achooo Jul 27, 2023
b867e30
Improve telemetry_config_provider.go tests
Achooo Jul 27, 2023
d4b788a
Add race test
Achooo Jul 27, 2023
932633e
Add missing godoc
Achooo Jul 27, 2023
696966f
Remove mock for MetricsClient
Achooo Jul 27, 2023
1d58bf6
Avoid goroutine test panics
Achooo Jul 28, 2023
fea50d4
trying to kick CI lint issues by upgrading mod
Achooo Jul 28, 2023
bfebfb1
imprve test code and add hasher for testing
Achooo Jul 28, 2023
54eb748
Use structure logging for filters, fix error constants, and default t…
Achooo Jul 31, 2023
9677781
removed hashin and modify logic to simplify
Achooo Jul 31, 2023
c23798c
Improve race test and fix PR feedback by removing hash equals and avo…
Achooo Jul 31, 2023
235acac
Ran make go-mod-tidy
Achooo Jul 31, 2023
1ef0795
Use errtypes in the test
Achooo Jul 31, 2023
2e10100
Add changelog
Achooo Jul 31, 2023
952129c
add safety check for exporter endpoint
Achooo Jul 31, 2023
b46d5b9
remove require.Contains by using error types, fix structure logging, …
Achooo Aug 1, 2023
7ea6280
Fixed race test to have changing config values
Achooo Aug 1, 2023
d3522ee
Send success metric before modifying config
Achooo Aug 1, 2023
aaec9a6
Avoid the defer and move the success metric under
Achooo Aug 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update hcp deps test
  • Loading branch information
Achooo committed Jul 31, 2023
commit 2313673e4fe84f449de89c34c8c2ae57cfc5af02
12 changes: 6 additions & 6 deletions agent/hcp/deps_test.go
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the tests were cleaned up thanks to the refactor of the URL parsing into the client.
New tests were added for the new TelemetryConfigProvider

Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ func TestSink(t *testing.T) {
},
expectedSink: true,
},
"noSinkWhenServerNotRegisteredWithCCM": {
expect: func(mockClient *client.MockClient) {
mt := mockTelemetryConfig(1*time.Second, nil, nil)
mockClient.EXPECT().FetchTelemetryConfig(mock.Anything).Return(mt, nil)
},
},
"noSinkWhenFetchTelemetryConfigFails": {
expect: func(mockClient *client.MockClient) {
mockClient.EXPECT().FetchTelemetryConfig(mock.Anything).Return(nil, fmt.Errorf("fetch failed"))
},
wantErr: "failed to fetch telemetry config",
},
"noSinkWhenServerNotRegisteredWithCCM": {
expect: func(mockClient *client.MockClient) {
mt := mockTelemetryConfig(1*time.Second, nil, nil)
mockClient.EXPECT().FetchTelemetryConfig(mock.Anything).Return(mt, nil)
},
},
"noSinkWhenTelemetryConfigProviderInitFails": {
expect: func(mockClient *client.MockClient) {
u, _ := url.Parse("https://test.com/v1/metrics")
Expand Down