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

Support latest DogStatsD version #31296

Merged
merged 3 commits into from
Feb 27, 2024

Conversation

jverce
Copy link
Contributor

@jverce jverce commented Feb 16, 2024

Description:

  • Support DogStatsD v1.2 by accepting metrics with container IDs
  • Support DogStatsD v1.3 by accepting metrics with timestamps
  • Add tests for the cases above
  • Improve readability in statsd_parser_test.go when calling testStatsDMetric
  • Add changelog entry

Link to tracking Issue: #31295

Testing:

  1. Added unit tests to validate that the new fields are accepted and interpreted correctly
  2. Manual tests to verify that the metrics go through a collector pipeline. Notice the container_id attribute and the Timestamp field, which contains a custom value different from StartTimestamp:
ScopeMetrics #0
ScopeMetrics SchemaURL:
InstrumentationScope otelcol/statsdreceiver 0.94.0-dev
Metric #0
Descriptor:
     -> Name: workflow_execution.failure
     -> Description:
     -> Unit:
     -> DataType: Sum
     -> IsMonotonic: false
     -> AggregationTemporality: Delta
NumberDataPoints #0
Data point attributes:
     -> container_id: Str(d69b8773f0ac1d93447a5835cb4ed1bf13dd336d32994830687ae1f352c86fe4)
     -> deployment.id: Str(d_0lBskd)
     -> metric_type: Str(counter)
     -> env: Str(development)
     -> project.id: Str(proj_kYRs18)
     -> trace.id: Str(2cQtSfsef2TN3EC2psGIorPaFd8)
     -> workflow.id: Str(p_0PACqQ)
StartTimestamp: 2024-02-16 03:53:30.323425523 +0000 UTC
Timestamp: 2024-02-16 03:53:51 +0000 UTC
Value: 1

Documentation: No docs added

@jverce jverce requested a review from a team February 16, 2024 14:41
@github-actions github-actions bot added the receiver/statsd statsd related issues label Feb 16, 2024
@jverce jverce force-pushed the feat/support-latest-dogstatsd branch from 8677e7f to 2f2e048 Compare February 20, 2024 20:38
@jverce jverce force-pushed the feat/support-latest-dogstatsd branch from 2f2e048 to d57542f Compare February 27, 2024 14:43
@github-actions github-actions bot added the cmd/otelcontribcol otelcontribcol command label Feb 27, 2024
@jverce jverce requested a review from dmitryax February 27, 2024 14:47
Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

One nit. Otherwise, LGTM

receiver/statsdreceiver/internal/protocol/statsd_parser.go Outdated Show resolved Hide resolved
* Support DogStatsD v1.2 by accepting metrics with container IDs
* Support DogStatsD v1.3 by accepting metrics with timestamps
* Add tests for the cases above
* Improve readability in `statsd_parser_test.go` when calling
  `testStatsDMetric`
* Add changelog entry
@jverce jverce force-pushed the feat/support-latest-dogstatsd branch from 2a93ff4 to 0d034ca Compare February 27, 2024 17:53
@dmitryax dmitryax merged commit 414cfa1 into open-telemetry:main Feb 27, 2024
142 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 27, 2024
@jverce jverce deleted the feat/support-latest-dogstatsd branch February 27, 2024 21:51
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
**Description:**
* Support DogStatsD v1.2 by accepting metrics with container IDs
* Support DogStatsD v1.3 by accepting metrics with timestamps
* Add tests for the cases above
* Improve readability in `statsd_parser_test.go` when calling
`testStatsDMetric`
* Add changelog entry

**Link to tracking Issue:** open-telemetry#31295

**Testing:**
1. Added unit tests to validate that the new fields are accepted and
interpreted correctly
2. Manual tests to verify that the metrics go through a collector
pipeline. Notice the `container_id` attribute and the `Timestamp` field,
which contains a custom value different from `StartTimestamp`:
```
ScopeMetrics #0
ScopeMetrics SchemaURL:
InstrumentationScope otelcol/statsdreceiver 0.94.0-dev
Metric #0
Descriptor:
     -> Name: workflow_execution.failure
     -> Description:
     -> Unit:
     -> DataType: Sum
     -> IsMonotonic: false
     -> AggregationTemporality: Delta
NumberDataPoints #0
Data point attributes:
     -> container_id: Str(d69b8773f0ac1d93447a5835cb4ed1bf13dd336d32994830687ae1f352c86fe4)
     -> deployment.id: Str(d_0lBskd)
     -> metric_type: Str(counter)
     -> env: Str(development)
     -> project.id: Str(proj_kYRs18)
     -> trace.id: Str(2cQtSfsef2TN3EC2psGIorPaFd8)
     -> workflow.id: Str(p_0PACqQ)
StartTimestamp: 2024-02-16 03:53:30.323425523 +0000 UTC
Timestamp: 2024-02-16 03:53:51 +0000 UTC
Value: 1
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/otelcontribcol otelcontribcol command receiver/statsd statsd related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants