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

[dogstatsd] discard timestamp < 1 in the no-aggregation pipeline. #13562

Merged
merged 3 commits into from
Sep 16, 2022

Conversation

remeh
Copy link
Contributor

@remeh remeh commented Sep 16, 2022

What does this PR do?

Reject timestamp < 1 in the no-aggregation pipeline.

Motivation

Even if not expected, avoid weird edge-cases down the road in other pipelines.

Describe how to test/QA your changes

  • Start the Agent
  • Send a metric with a valid timestamp: echo -n "custom_metric:60|g|#env:test,dev:remy|T$(( $(date +%s) - 7200 ))" | nc -4u -w0 127.0.0.1 8125
  • Send a metric with an invalid timestamp: echo -n "custom_metric:60|g|#env:test,dev:remy|T0" | nc -4u -w0 127.0.0.1 8125
  • Send a metric with an invalid timestamp: echo -n "custom_metric:60|g|#env:test,dev:remy|T-1" | nc -4u -w0 127.0.0.1 8125
  • Generate a flare
  • in expvars/dogstatsd, validate that MetricPackets equals 1 and that MetricParseErrors equals 2

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
  • At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the k8s/<min-version> label, indicating the lowest Kubernetes version compatible with this feature.
  • If applicable, the config template has been updated.

Copy link
Contributor

@scottopell scottopell left a comment

Choose a reason for hiding this comment

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

Good QA plan! Small nit on a comment, but lgtm

pkg/dogstatsd/parse_metrics_test.go Outdated Show resolved Hide resolved
@remeh remeh merged commit f2a93fa into main Sep 16, 2022
@remeh remeh deleted the remeh/no-agg-positive-timestamp branch September 16, 2022 16:35
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.

3 participants