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

[samplers/jaegerremote] Change parser to support enums as both strings and numbers #3183

Merged
merged 6 commits into from
Feb 8, 2023

Conversation

yurishkuro
Copy link
Member

@yurishkuro yurishkuro commented Jan 26, 2023

Resolves #3184

  • Switch from encoding/json to gogoproto/jsonpb parser that works for both string and number enums in JSON

@yurishkuro yurishkuro changed the title [samplers/jaegerremote] [WIP] Add unit test to illustrate a problem with format [samplers/jaegerremote] [do not merge] Add unit test to illustrate a problem with format Jan 26, 2023
@codecov
Copy link

codecov bot commented Jan 27, 2023

Codecov Report

Merging #3183 (bd0f9a2) into main (0a2a048) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #3183   +/-   ##
=====================================
  Coverage   69.5%   69.5%           
=====================================
  Files        147     147           
  Lines       6890    6894    +4     
=====================================
+ Hits        4789    4796    +7     
+ Misses      1980    1978    -2     
+ Partials     121     120    -1     
Impacted Files Coverage Δ
samplers/jaegerremote/sampler_remote.go 89.6% <100.0%> (+2.2%) ⬆️

@yurishkuro yurishkuro changed the title [samplers/jaegerremote] [do not merge] Add unit test to illustrate a problem with format [samplers/jaegerremote] Change parser to support enums as both strings and numbers Jan 27, 2023
Copy link
Member

@Aneurysm9 Aneurysm9 left a comment

Choose a reason for hiding this comment

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

Other than the linter not liking your variable names, this LGTM.

samplers/jaegerremote/sampler_remote_test.go Outdated Show resolved Hide resolved
@Aneurysm9 Aneurysm9 closed this Jan 27, 2023
@Aneurysm9 Aneurysm9 reopened this Jan 27, 2023
@yurishkuro
Copy link
Member Author

can this be merged?

@MrAlias MrAlias merged commit 6178903 into open-telemetry:main Feb 8, 2023
@Narenderbhcu
Copy link

Hi, Can you please provide the release plan for this changes?

@yurishkuro yurishkuro deleted the jaegerremote_unittests branch February 17, 2023 04:44
@MrAlias MrAlias added this to the v0.39.0 milestone Feb 17, 2023
rfratto added a commit to rfratto/agent that referenced this pull request Mar 11, 2023
This fixes an issue where the remote sampler could not be parsed if it
used strings for the strategy type instead of numbers. The resolution is
to switch to the protobuf JSON encoding, which properly parses this type
as a string.

Not being able to parse the remote sampler rules meant that sampling
rate fell back to the default (10%).

This change is equivalent to
open-telemetry/opentelemetry-go-contrib#3183. We are still unable to
move to the upstream type while
open-telemetry/opentelemetry-go-contrib#2981 remains unresolved.
rfratto added a commit to grafana/agent that referenced this pull request Mar 11, 2023
This fixes an issue where the remote sampler could not be parsed if it
used strings for the strategy type instead of numbers. The resolution is
to switch to the protobuf JSON encoding, which properly parses this type
as a string.

Not being able to parse the remote sampler rules meant that sampling
rate fell back to the default (10%).

This change is equivalent to
open-telemetry/opentelemetry-go-contrib#3183. We are still unable to
move to the upstream type while
open-telemetry/opentelemetry-go-contrib#2981 remains unresolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[samplers/jaegerremote] Invalid expectation of JSON format
5 participants