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

Error writing string fields to stackdriver output #5315

Closed
ihsw opened this issue Jan 18, 2019 · 5 comments · Fixed by #5384
Closed

Error writing string fields to stackdriver output #5315

ihsw opened this issue Jan 18, 2019 · 5 comments · Fixed by #5384
Assignees
Labels
area/gcp Google Cloud plugins including cloud_pubsub, cloud_pubsub_push, stackdriver bug unexpected problem or unintended behavior
Milestone

Comments

@ihsw
Copy link

ihsw commented Jan 18, 2019

Relevant telegraf.conf:

# # Configuration for Google Cloud Stackdriver to send metrics to
[[outputs.stackdriver]]
#   # GCP Project
  project = "$PROJECT_ID"
#
#   # The namespace for the metric descriptor
  namespace = "telegraf"

System info:

$ telegraf --version
Telegraf 1.9.2 (git: HEAD dda80799)

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename:	bionic

[Include Telegraf version, operating system name, and other relevant details]

Steps to reproduce:

  1. Uncomment outputs.stackdriver config
  2. Ensure GCE VM has Monitoring Metric Writer IAM role

Expected behavior:

Logs are pushed to StackDriver

Actual behavior:

Error when starting Telegraf:

2019-01-18T20:58:11Z E! [agent] Error writing to output [stackdriver]: rpc error: code = InvalidArgument desc = Field metricDescriptor.valueType had an invalid value of "STRING": When creating metric custom.googleapis.com/telegraf/system/uptime_format: the value type is not supported for custom metrics.

Additional info:

Not sure what else to do to get this working.

@danielnelson danielnelson self-assigned this Jan 18, 2019
@danielnelson
Copy link
Contributor

As a temporary workaround, you could use the fielddrop metric filtering parameter to drop any string fields. This should clear up the error but may be tedious if you have many string fields.

[[outputs.stackdriver]]
  fielddrop = ["uptime_format"]

@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Jan 18, 2019
@ihsw
Copy link
Author

ihsw commented Jan 18, 2019

@danielnelson that worked! Thank you so much.

@danielnelson danielnelson added the area/gcp Google Cloud plugins including cloud_pubsub, cloud_pubsub_push, stackdriver label Feb 1, 2019
@danielnelson danielnelson added this to the 1.10.0 milestone Feb 6, 2019
@danielnelson danielnelson changed the title Error writing to output [stackdriver] Error writing string fields to stackdriver output Feb 6, 2019
@ihsw
Copy link
Author

ihsw commented Feb 6, 2019

@danielnelson thank you for fixing this! Also, hopefully StackDriver's Metric pricing becomes more reasonable. Feeding Telegraf telemetry into StackDriver can be pricey per GCE instance.

One might consider using Telegraf+StackDriver with per-minute resolution rather than per-second, to significantly reduce costs.

@danielnelson
Copy link
Contributor

It seems that Stackdriver supports 1m resolution max for custom metrics, so you will want to reduce the collection interval or aggregate the metrics before sending them to Stackdriver.

There are some other limitations I have found, which lead me to believe that it makes the most sense to send only certain metrics to Stackdriver while pushing the bulk of the data to InfluxDB. I just added this note to the documentation: https://github.com/influxdata/telegraf/tree/master/plugins/outputs/stackdriver#restrictions

@ihsw
Copy link
Author

ihsw commented Feb 7, 2019

@danielnelson these are excellent solutions. I have also noticed StackDriver barfing errors when receiving data points out-of-order. The only remedy was to restart telegraf and be (un)happy with a gap in data.

The basistats aggregator looks excellent.

@danielnelson danielnelson modified the milestones: 1.10.0, 1.9.5 Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gcp Google Cloud plugins including cloud_pubsub, cloud_pubsub_push, stackdriver bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants