influxdata / influxdata/kapacitor

Bug: Invalid field format when using tags() on eval()

Open
#1,484 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

Kapacitor version: 1.3
Influxdb version: 1.3
Both on dockers running Debian GNU/Linux 8 (jessie)

I'm running this tick, which suppose to add a specific tag to when certain fields exist:
```
stream
|from()
.measurement('cloudwatch_aws_ecs')
|where(lambda: "cluster_name" == 'awseb-my-env-cloud-id')
|eval(lambda: string('qa-ServiceAccess')).as('app_name').tags('app_name')
// Write the transformed data to InfluxDB
|influxDBOut()
.database('telegraf')
.retentionPolicy('autogen')
.measurement('cloudwatch_aws_ecs')
```

Upon writing to influxdb, I'm getting this error message:
`[cap_naming:influxdb_out4] 2017/07/18 13:00:06 E! failed to write points to InfluxDB: unable to parse 'cloudwatch_aws_ecs,app_name_1=qa-CreditServiceAccess,cluster_name=awseb-my-env-cloud-id,host=123ef333f1df,region=eu-west-1,renamed=true,unit=percent 1500382140000000000': invalid field format
`

This only happens when adding tags with eval().*.as().tags()
When adding static tags only, i.e:
```
|influxDBOut()
.database('telegraf')
.retentionPolicy('autogen')
.measurement('cloudwatch_aws_ecs')
.tag('renamed', 'true')
```
Everything works

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the provided Kapacitor script and compare eval().as().tags() with the working static .tag() case at influxDBOut. Trace the resulting point into InfluxDB and verify that the corrected behavior writes without an invalid field format error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.