Skip to content

OpenTsdbWriter#CheckResultHandler(): skip custom tags with empty values#7928

Merged
Al2Klimov merged 1 commit intomasterfrom
bugfix/opentsdb-custom-tag-empty-string-7724
Apr 18, 2024
Merged

OpenTsdbWriter#CheckResultHandler(): skip custom tags with empty values#7928
Al2Klimov merged 1 commit intomasterfrom
bugfix/opentsdb-custom-tag-empty-string-7724

Conversation

@Al2Klimov
Copy link
Copy Markdown
Member

@Al2Klimov Al2Klimov commented Mar 18, 2020

as the DB can't handle them.

fixes #7724

@Al2Klimov Al2Klimov added this to the 2.13.0 milestone Mar 18, 2020
@julianbrost julianbrost removed this from the 2.13.0 milestone May 31, 2021
@Al2Klimov
Copy link
Copy Markdown
Member Author

@cla-bot check

@cla-bot cla-bot bot added the cla/signed label Aug 4, 2021
@Al2Klimov Al2Klimov marked this pull request as ready for review August 10, 2021 19:03
@Al2Klimov Al2Klimov added this to the 2.14.0 milestone Sep 7, 2022
@julianbrost julianbrost removed this from the 2.14.0 milestone Jan 23, 2023
@Al2Klimov
Copy link
Copy Markdown
Member Author

Test

DB: docker run --rm -itp 4242:4242 vulhub/opentsdb:2.4.0

/etc/icinga2/features-available/opentsdb.conf

object OpenTsdbWriter "opentsdb" {
  host = "127.0.0.1"
  port = 4242

  host_template = {
    metric = "icinga.host"
    tags = {
      zone = "$host.zone$"
      lolcat= ""
    }
  }
  service_template = {
    metric = "icinga.service.$service.check_command$"
    tags = {
      zone = "$service.zone$"
      lolcat= ""
    }
  }
}

Before

java.lang.IllegalArgumentException: invalid tag: lolcat=
	at net.opentsdb.core.Tags.parse(Tags.java:91)
	at net.opentsdb.tsd.PutDataPointRpc.importDataPoint(PutDataPointRpc.java:770)
	at net.opentsdb.tsd.PutDataPointRpc.execute(PutDataPointRpc.java:220)
	at net.opentsdb.tsd.RpcHandler.handleTelnetRpc(RpcHandler.java:161)
	at net.opentsdb.tsd.RpcHandler.messageReceived(RpcHandler.java:131)
	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
	at org.jboss.netty.handler.timeout.IdleStateAwareChannelUpstreamHandler.handleUpstream(IdleStateAwareChannelUpstreamHandler.java:36)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
	at org.jboss.netty.handler.timeout.IdleStateHandler.messageReceived(IdleStateHandler.java:294)
	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
	at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
	at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
	at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
	at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
	at org.jboss.netty.channel.SimpleChannelHandler.messageReceived(SimpleChannelHandler.java:142)
	at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88)
	at net.opentsdb.tsd.ConnectionManager.handleUpstream(ConnectionManager.java:128)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
	at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
	at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
	at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
	at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

After

[2024-01-18 11:19:32 +0100] debug/OpenTsdbWriter: Resolved macro '' for this host or service to '', skipping.

@Al2Klimov Al2Klimov force-pushed the bugfix/opentsdb-custom-tag-empty-string-7724 branch from e6ec259 to c0e2fce Compare March 14, 2024 15:45
@Al2Klimov Al2Klimov requested a review from yhabteab March 28, 2024 09:49
@Al2Klimov Al2Klimov force-pushed the bugfix/opentsdb-custom-tag-empty-string-7724 branch from c0e2fce to e41f007 Compare March 28, 2024 13:03
Copy link
Copy Markdown
Member

@yhabteab yhabteab left a comment

Choose a reason for hiding this comment

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

Please fix the Windows build! Other than that, the PR LFTM!

@Al2Klimov Al2Klimov added this to the 2.15.0 milestone Apr 4, 2024
@Al2Klimov
Copy link
Copy Markdown
Member Author

Nice to have, but doesn't matter as we don't include perfdata writers on Windows.

@Al2Klimov Al2Klimov enabled auto-merge April 18, 2024 09:35
@Al2Klimov Al2Klimov force-pushed the bugfix/opentsdb-custom-tag-empty-string-7724 branch from e41f007 to 5c17465 Compare April 18, 2024 09:36
@Al2Klimov Al2Klimov merged commit 7aaaa0b into master Apr 18, 2024
@Al2Klimov Al2Klimov deleted the bugfix/opentsdb-custom-tag-empty-string-7724 branch April 18, 2024 11:32
@Al2Klimov Al2Klimov added the consider backporting Should be considered for inclusion in a bugfix release label May 14, 2024
@yhabteab yhabteab removed the consider backporting Should be considered for inclusion in a bugfix release label Nov 14, 2024
@Al2Klimov Al2Klimov added the consider backporting Should be considered for inclusion in a bugfix release label Feb 4, 2025
@Al2Klimov Al2Klimov mentioned this pull request Feb 4, 2025
@yhabteab yhabteab removed the consider backporting Should be considered for inclusion in a bugfix release label Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

OpenTSDB / Custom Tag / empty string => failure

3 participants