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(influxdbexporter): handle empty attribute values #21526

Merged

Conversation

jacobmarble
Copy link
Contributor

Description:
Since otelcol-contrib v0.75.0, the hostmetrics receiver is emitting metrics with empty string attribute values, such as device = string(""). I've confirmed that this behavior started in v0.75.0.

I'm not certain that empty attribute values are disallowed in the otel spec, but this error is emitted by the InfluxDB line protocol encoder, which has rejected empty tag values for at least three years.

Nevertheless, the InfluxDB exporter can do better by quietly dropping these attributes (which is semantically equivalent in InfluxDB).

Link to tracking Issue:
Closes #21474

Testing:
Unit tested the changed method.

Documentation: n/a

@dmitryax
Copy link
Member

dmitryax commented May 7, 2023

@jacobmarble there is another linter error, PTAL

@dmitryax dmitryax merged commit da70db7 into open-telemetry:main May 8, 2023
@github-actions github-actions bot added this to the next release milestone May 8, 2023
@jacobmarble jacobmarble deleted the jgm-influx-empty-tag-values branch May 8, 2023 16:56
jacobmarble added a commit to jacobmarble/opentelemetry-collector-contrib that referenced this pull request Aug 30, 2023
Closes open-telemetry#22850

InfluxDB does not allow empty tag values in line protocol. This change
adds a second test to confirm that the InfluxDB exporter does not emit
empty tag values.

See open-telemetry#21526 for the original fix to handling empty attribute values. This
PR exists because I forgot I had fixed open-telemetry#21474, then tried to fix open-telemetry#22850
and now realize that open-telemetry#22850 and open-telemetry#21474 are dupes. Live and learn.
codeboten pushed a commit that referenced this pull request Sep 15, 2023
**Description:** <Describe what has changed.>

InfluxDB does not allow empty tag values in line protocol. This change
adds a second test to confirm that the InfluxDB exporter does not emit
empty tag values.
    
See #21526 for the original fix to handling empty attribute values. This
PR exists because I forgot I had fixed #21474, then tried to fix #22850
and now realize that #22850 and #21474 are dupes. Live and learn.

**Link to tracking Issue:**

Closes #22850

**Testing:**

**Documentation:**
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.

influxdbexporter does not support empty tag values from hostmetrics process scraper
3 participants