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

Make all-in-one.yaml file independant of sampling-strategies.json file #6420

Closed

Conversation

adityachopra29
Copy link

Which problem is this PR solving?

Description of the changes

  • Removed the hardcoded path in the default configuration (all-in-one.yaml).
  • updated the validate function to accept a null value of sampling-strategy file from all-in-one.yaml config file
  • updated tests accordingly

How was this change tested?

  • Since some of the tests are using hardcoded services in sampling-strategies.json (the service "foo").

    the sampling-strategies.json file could not be removed
  • Also, right now there are some tests, namely:
    1.) TestServerHTTP_TracesRequest,
    2.) all 3 tests in cmd/query/app
    which are not passing even on the main branch itself (according to me, otherwise I have made some mistake), and hence these same tests are not passing after I made my changes (my changes should not affect them anyway).

Checklist

@adityachopra29 adityachopra29 requested a review from a team as a code owner December 26, 2024 20:26
@yurishkuro
Copy link
Member

before you go any further please make sure you always sign commits

@@ -78,10 +75,6 @@ func (cfg *Config) Unmarshal(conf *confmap.Conf) error {
}

func (cfg *Config) Validate() error {
if cfg.File == nil && cfg.Adaptive == nil {
Copy link
Member

Choose a reason for hiding this comment

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

allowing empty file name does not mean we allow not specifying a provider

Copy link
Author

Choose a reason for hiding this comment

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

Okay. so what shall we take as the default strategy, (since if we want to remove dependancy on sampling-strategies.json, then there would be no default input left). I had allowed null for that reason

Copy link
Member

Choose a reason for hiding this comment

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

Do not confuse strategy (the final output) with the provider (file or adaptive). I still want to use file provider in this case, but without a file name the provider can return a default strategy, which is probabilistic/1.0

Copy link
Member

Choose a reason for hiding this comment

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

The reason to still use the file provider is because the user can override the file name via --set CLI flag, even if they do not provide a full config file.

Copy link
Author

Choose a reason for hiding this comment

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

okay, got it, so I just have to add this test back again.
I had accidentally closed this pr, so creating a new one

@@ -30,7 +30,7 @@ extensions:
remote_sampling:
# We can either use file or adaptive sampling strategy in remote_sampling
file:
path: ./cmd/jaeger/sampling-strategies.json
path: ~
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
path: ~
path:

@adityachopra29 adityachopra29 deleted the fix-sampling-config branch December 27, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: v2 all-in-one binary cannot find sampling strategies file
2 participants