[
https://issues.apache.org/jira/browse/NIFI-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14988717#comment-14988717
]
ASF GitHub Bot commented on NIFI-987:
-------------------------------------
Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi/pull/91#discussion_r43834423
--- Diff:
nifi-nar-bundles/nifi-riemann-bundle/nifi-riemann-processors/src/main/java/org/apache/nifi/processors/riemann/PutRiemann.java
---
@@ -0,0 +1,376 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.processors.riemann;
+
+import com.aphyr.riemann.Proto;
+import com.aphyr.riemann.Proto.Event;
+import com.aphyr.riemann.client.RiemannClient;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.SupportsBatching;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.components.PropertyValue;
+import org.apache.nifi.components.Validator;
+import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.processor.AbstractProcessor;
+import org.apache.nifi.processor.ProcessContext;
+import org.apache.nifi.processor.ProcessSession;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+@Tags({"riemann", "monitoring", "metrics"})
+@DynamicProperty(name = "Custom Event Attribute",
supportsExpressionLanguage = true,
+ description = "These values will be attached to the Riemann event as a
custom attribute",
+ value = "Any value or expression")
+@CapabilityDescription("Send events to Riemann")
+@SupportsBatching
+public class PutRiemann extends AbstractProcessor {
+ protected enum Transport {
+ TCP, UDP
+ }
+
+ protected RiemannClient riemannClient = null;
+ protected Transport transport;
+
+ public static final Relationship REL_SUCCESS = new Relationship.Builder()
+ .name("success")
+ .description("Metrics successfully written to Riemann")
+ .build();
+
+ public static final Relationship REL_FAILURE = new Relationship.Builder()
+ .name("failure")
+ .description("Metrics which failed to write to Riemann")
+ .build();
+
+
+ public static final PropertyDescriptor RIEMANN_HOST = new
PropertyDescriptor.Builder()
+ .name("Riemann Address")
+ .description("Hostname of Riemann server")
+ .required(true)
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .build();
+
+ public static final PropertyDescriptor RIEMANN_PORT = new
PropertyDescriptor.Builder()
+ .name("Riemann Port")
+ .description("Port that Riemann is listening on")
+ .required(true)
+ .defaultValue("5555")
+ .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+ .addValidator(StandardValidators.INTEGER_VALIDATOR)
--- End diff --
StandardValidators.POSITIVE_INTEGER_VALIDATOR is more appropriate for a port
> Add Processor for Writing Events to Riemann
> -------------------------------------------
>
> Key: NIFI-987
> URL: https://issues.apache.org/jira/browse/NIFI-987
> Project: Apache NiFi
> Issue Type: New Feature
> Reporter: Ricky Saltzer
> Assignee: Ricky Saltzer
> Fix For: 0.4.0
>
> Attachments: Sample Riemann Dataflow .png
>
>
> Riemann (http://riemann.io) is a new framework for monitoring distributed
> systems. It's particular useful for sending ad-hoc events such as, heartbeats
> and metrics. It would be nice if NiFi had a PutRiemann processor for writing
> events using the NiFi expression language.
> A simple use case would be a data flow that repeatedly checks specific
> services over TCP, HTTP, etc and checks into Riemann. Another example would
> be detecting a blip in events coming down a stream using a simple event
> heartbeat mechanism. I'll post a couple visuals to help make these examples
> more concrete.
> I have an initial PutRiemann processor made. I will post the patch via a
> Github pull request later today.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)