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

fix sample rate resulting in incorrect metrics #276

Merged
merged 3 commits into from
Sep 7, 2018

Conversation

rochdev
Copy link
Member

@rochdev rochdev commented Sep 7, 2018

This PR fixes the metrics being incorrect when a sample rate is set. The agent expects to receive a _sample_rate metrics so it knows to calculate the correct average according to this value. Since this value was not sent, the metrics would be calculated with the assumption that all traces are sampled at the client.

@rochdev rochdev added bug Something isn't working core labels Sep 7, 2018
Copy link
Member

@Kyle-Verhoog Kyle-Verhoog left a comment

Choose a reason for hiding this comment

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

Just a small nit.

super()

const startTime = fields.startTime || platform.now()
const operationName = fields.operationName
const parent = fields.parent || null
const tags = fields.tags || {}
const metrics = {
_sample_rate: sampler.rate()
Copy link
Member

Choose a reason for hiding this comment

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

This key should probably be a constant.

@rochdev rochdev merged commit ff14b64 into master Sep 7, 2018
@rochdev rochdev deleted the fix-sample-rate-metrics branch September 7, 2018 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants