Skip to content

Commit

Permalink
Allow non-integral X-Ray sampling rates (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChimeraCoder authored Sep 17, 2020
1 parent 52d1f59 commit f0abcf0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,5 @@ type Config struct {
} `yaml:"veneur_metrics_scopes"`
XrayAddress string `yaml:"xray_address"`
XrayAnnotationTags []string `yaml:"xray_annotation_tags"`
XraySamplePercentage int `yaml:"xray_sample_percentage"`
XraySamplePercentage float64 `yaml:"xray_sample_percentage"`
}
4 changes: 1 addition & 3 deletions example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,9 @@ signalfx_dynamic_per_tag_api_keys_refresh_period: "10m"
xray_address: "localhost:2000"

# Sample rate in percent (as an integer)
# This should ideally be a floating point number, but at the time this was
# written, gojson interpreted whole-number floats in yaml as integers.
# The sink will hash the trace id of the span such that all Veneur instances
# will sample the same segments by using the trace id as input for a checksum.
xray_sample_percentage: 100
xray_sample_percentage: 100.0

# All tags are sent as (unindexed) Metadata to X-ray. Up to 50 tags per trace
# (not per span) can be indexed as Annotations for search. Tag keys specified here
Expand Down
2 changes: 1 addition & 1 deletion sinks/xray/xray.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type XRaySpanSink struct {
var _ sinks.SpanSink = &XRaySpanSink{}

// NewXRaySpanSink creates a new instance of a XRaySpanSink.
func NewXRaySpanSink(daemonAddr string, sampleRatePercentage int, commonTags map[string]string, annotationTags []string, log *logrus.Logger) (*XRaySpanSink, error) {
func NewXRaySpanSink(daemonAddr string, sampleRatePercentage float64, commonTags map[string]string, annotationTags []string, log *logrus.Logger) (*XRaySpanSink, error) {

log.WithFields(logrus.Fields{
"Address": daemonAddr,
Expand Down

0 comments on commit f0abcf0

Please sign in to comment.