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

Carbon receiver drops metrics with float timestamps #31312

Closed
jonnangle opened this issue Feb 19, 2024 · 2 comments
Closed

Carbon receiver drops metrics with float timestamps #31312

jonnangle opened this issue Feb 19, 2024 · 2 comments
Labels
bug Something isn't working needs triage New item requiring triage receiver/carbon

Comments

@jonnangle
Copy link
Contributor

Component(s)

receiver/carbon

What happened?

Description

The carbon receiver expects an integer timestamp, and will raise an error if a float is provided:

collector-1   | 2024-02-16T12:08:20.276Z	debug	carbonreceiver@v0.94.0/reporter.go:60	Carbon translation error	{"kind": "receiver", "name": "carbon", "data_type": "metrics", "error": "invalid carbon metric time [my.metric 151 1708085258.254]: strconv.ParseInt: parsing \"1708085258.254\": invalid syntax"}

This is causing us some issues, as we have carbon clients that are providing a float timestamp. The carbon protocol does suggest that an integer Unix timestamp should be used, but there is some prior art for allowing a float (which is why this has been working for us up until now!):

Steps to Reproduce

Send a carbon plaintext metric with a float timestamp, e.g. my.metric 151 1708085258.254

Expected Result

The timestamp is accepted as if it were an int.

Actual Result

An error is raised and the metric is dropped.

Collector version

0.94.0

Environment information

Environment

Using opentelemetry-collector-contrib docker image

OpenTelemetry Collector configuration

No response

Log output

collector-1   | 2024-02-16T12:08:20.276Z	debug	carbonreceiver@v0.94.0/reporter.go:60	Carbon translation error	{"kind": "receiver", "name": "carbon", "data_type": "metrics", "error": "invalid carbon metric time [my.metric 151 1708085258.254]: strconv.ParseInt: parsing \"1708085258.254\": invalid syntax"}

Additional context

No response

@jonnangle jonnangle added bug Something isn't working needs triage New item requiring triage labels Feb 19, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member

Resolved in #31313

XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this issue Mar 13, 2024
**Description:** 

This allows timestamps to be sent as floats.

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

**Testing:** 

Added unit test case with float timestamp.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage receiver/carbon
Projects
None yet
Development

No branches or pull requests

2 participants