You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by patricklucas <gi...@git.apache.org> on 2017/07/11 15:03:27 UTC

[GitHub] flink pull request #4299: [FLINK-7155] [metrics] Add Influxdb reporter

GitHub user patricklucas opened a pull request:

    https://github.com/apache/flink/pull/4299

    [FLINK-7155] [metrics] Add Influxdb reporter

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/patricklucas/flink FLINK-7155_add_influxdb_metrics_reporter

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/4299.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4299
    
----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #4299: [FLINK-7155] [metrics] Add Influxdb reporter

Posted by patricklucas <gi...@git.apache.org>.
Github user patricklucas commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4299#discussion_r126742051
  
    --- Diff: flink-metrics/flink-metrics-influxdb/pom.xml ---
    @@ -0,0 +1,97 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<!--
    +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.
    +-->
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    +
    +	<modelVersion>4.0.0</modelVersion>
    +
    +	<parent>
    +		<groupId>org.apache.flink</groupId>
    +		<artifactId>flink-metrics</artifactId>
    +		<version>1.4-SNAPSHOT</version>
    +		<relativePath>..</relativePath>
    +	</parent>
    +
    +	<artifactId>flink-metrics-influxdb</artifactId>
    +	<name>flink-metrics-influxdb</name>
    +
    +	<dependencies>
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-annotations</artifactId>
    +			<version>${project.version}</version>
    +			<scope>provided</scope>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-metrics-core</artifactId>
    +			<version>${project.version}</version>
    +			<scope>provided</scope>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-metrics-dropwizard</artifactId>
    +			<version>${project.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>io.dropwizard.metrics</groupId>
    +			<artifactId>metrics-core</artifactId>
    +			<version>${metrics.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>io.dropwizard.metrics</groupId>
    +			<artifactId>metrics-graphite</artifactId>
    --- End diff --
    
    This was errant; I'll remove it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #4299: [FLINK-7155] [metrics] Add Influxdb reporter

Posted by patricklucas <gi...@git.apache.org>.
Github user patricklucas commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4299#discussion_r126742152
  
    --- Diff: flink-metrics/flink-metrics-influxdb/pom.xml ---
    @@ -0,0 +1,97 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<!--
    +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.
    +-->
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    +
    +	<modelVersion>4.0.0</modelVersion>
    +
    +	<parent>
    +		<groupId>org.apache.flink</groupId>
    +		<artifactId>flink-metrics</artifactId>
    +		<version>1.4-SNAPSHOT</version>
    +		<relativePath>..</relativePath>
    +	</parent>
    +
    +	<artifactId>flink-metrics-influxdb</artifactId>
    +	<name>flink-metrics-influxdb</name>
    +
    +	<dependencies>
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-annotations</artifactId>
    +			<version>${project.version}</version>
    +			<scope>provided</scope>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-metrics-core</artifactId>
    +			<version>${project.version}</version>
    +			<scope>provided</scope>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-metrics-dropwizard</artifactId>
    +			<version>${project.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>io.dropwizard.metrics</groupId>
    +			<artifactId>metrics-core</artifactId>
    +			<version>${metrics.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>io.dropwizard.metrics</groupId>
    +			<artifactId>metrics-graphite</artifactId>
    +			<version>${metrics.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>com.github.davidb</groupId>
    +			<artifactId>metrics-influxdb</artifactId>
    +			<version>0.9.3</version>
    +		</dependency>
    +	</dependencies>
    +
    +	<build>
    +		<plugins>
    +			<plugin>
    +				<artifactId>maven-assembly-plugin</artifactId>
    +				<version>2.4</version>
    +				<configuration>
    +					<descriptorRefs>
    +						<descriptorRef>jar-with-dependencies</descriptorRef>
    --- End diff --
    
    This is exactly how the graphite reporter does it, which is extremely similar to this one. I'm not sure exactly what you want me to change here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #4299: [FLINK-7155] [metrics] Add Influxdb reporter

Posted by gobozov <gi...@git.apache.org>.
Github user gobozov commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4299#discussion_r159136038
  
    --- Diff: flink-metrics/flink-metrics-influxdb/src/main/java/org/apache/flink/metrics/influxdb/InfluxdbReporter.java ---
    @@ -0,0 +1,76 @@
    +/*
    + * 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.flink.metrics.influxdb;
    +
    +import org.apache.flink.annotation.PublicEvolving;
    +import org.apache.flink.dropwizard.ScheduledDropwizardReporter;
    +import org.apache.flink.metrics.MetricConfig;
    +
    +import com.codahale.metrics.MetricFilter;
    +import com.codahale.metrics.ScheduledReporter;
    +import metrics_influxdb.HttpInfluxdbProtocol;
    +import metrics_influxdb.api.measurements.CategoriesMetricMeasurementTransformer;
    +
    +import java.util.concurrent.TimeUnit;
    +
    +/**
    + * This class acts as a factory for the {@link metrics_influxdb.InfluxdbReporter} and allows using it as a Flink
    + * reporter.
    + */
    +@PublicEvolving
    +public class InfluxdbReporter extends ScheduledDropwizardReporter {
    +
    +	public static final String ARG_USER = "user";
    +	public static final String ARG_PASSWORD = "password";
    +	public static final String ARG_DB = "db";
    +
    +	@Override
    +	public ScheduledReporter getReporter(final MetricConfig config) {
    +		final String host = config.getString(ARG_HOST, "localhost");
    +		final Integer port = config.getInteger(ARG_PORT, HttpInfluxdbProtocol.DEFAULT_PORT);
    +		final String user = config.getString(ARG_USER, null);
    +		final String password = config.getString(ARG_PASSWORD, null);
    +		final String db = config.getString(ARG_DB, "flink");
    +		final String conversionRate = config.getString(ARG_CONVERSION_RATE, null);
    +		final String conversionDuration = config.getString(ARG_CONVERSION_DURATION, null);
    +
    +		final metrics_influxdb.InfluxdbReporter.Builder builder =
    +			metrics_influxdb.InfluxdbReporter.forRegistry(registry);
    +
    +		builder.protocol(new HttpInfluxdbProtocol(host, port, user, password, db));
    --- End diff --
    
    We built same thing for our needs using same InfluxDb reporter. The disadvantage is that it does not support https, we modified it to support sslContext. I also don't see way to provide tags to reporter builder.


---

[GitHub] flink pull request #4299: [FLINK-7155] [metrics] Add Influxdb reporter

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4299#discussion_r126723609
  
    --- Diff: flink-metrics/flink-metrics-influxdb/pom.xml ---
    @@ -0,0 +1,97 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<!--
    +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.
    +-->
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    +
    +	<modelVersion>4.0.0</modelVersion>
    +
    +	<parent>
    +		<groupId>org.apache.flink</groupId>
    +		<artifactId>flink-metrics</artifactId>
    +		<version>1.4-SNAPSHOT</version>
    +		<relativePath>..</relativePath>
    +	</parent>
    +
    +	<artifactId>flink-metrics-influxdb</artifactId>
    +	<name>flink-metrics-influxdb</name>
    +
    +	<dependencies>
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-annotations</artifactId>
    +			<version>${project.version}</version>
    +			<scope>provided</scope>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-metrics-core</artifactId>
    +			<version>${project.version}</version>
    +			<scope>provided</scope>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-metrics-dropwizard</artifactId>
    +			<version>${project.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>io.dropwizard.metrics</groupId>
    +			<artifactId>metrics-core</artifactId>
    +			<version>${metrics.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>io.dropwizard.metrics</groupId>
    +			<artifactId>metrics-graphite</artifactId>
    +			<version>${metrics.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>com.github.davidb</groupId>
    +			<artifactId>metrics-influxdb</artifactId>
    +			<version>0.9.3</version>
    +		</dependency>
    +	</dependencies>
    +
    +	<build>
    +		<plugins>
    +			<plugin>
    +				<artifactId>maven-assembly-plugin</artifactId>
    +				<version>2.4</version>
    +				<configuration>
    +					<descriptorRefs>
    +						<descriptorRef>jar-with-dependencies</descriptorRef>
    --- End diff --
    
    please use the maven-shade plugin instead.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #4299: [FLINK-7155] [metrics] Add Influxdb reporter

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4299#discussion_r126748789
  
    --- Diff: flink-metrics/flink-metrics-influxdb/pom.xml ---
    @@ -0,0 +1,97 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<!--
    +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.
    +-->
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    +
    +	<modelVersion>4.0.0</modelVersion>
    +
    +	<parent>
    +		<groupId>org.apache.flink</groupId>
    +		<artifactId>flink-metrics</artifactId>
    +		<version>1.4-SNAPSHOT</version>
    +		<relativePath>..</relativePath>
    +	</parent>
    +
    +	<artifactId>flink-metrics-influxdb</artifactId>
    +	<name>flink-metrics-influxdb</name>
    +
    +	<dependencies>
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-annotations</artifactId>
    +			<version>${project.version}</version>
    +			<scope>provided</scope>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-metrics-core</artifactId>
    +			<version>${project.version}</version>
    +			<scope>provided</scope>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-metrics-dropwizard</artifactId>
    +			<version>${project.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>io.dropwizard.metrics</groupId>
    +			<artifactId>metrics-core</artifactId>
    +			<version>${metrics.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>io.dropwizard.metrics</groupId>
    +			<artifactId>metrics-graphite</artifactId>
    +			<version>${metrics.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>com.github.davidb</groupId>
    +			<artifactId>metrics-influxdb</artifactId>
    +			<version>0.9.3</version>
    +		</dependency>
    +	</dependencies>
    +
    +	<build>
    +		<plugins>
    +			<plugin>
    +				<artifactId>maven-assembly-plugin</artifactId>
    +				<version>2.4</version>
    +				<configuration>
    +					<descriptorRefs>
    +						<descriptorRef>jar-with-dependencies</descriptorRef>
    --- End diff --
    
    We intend to use the shade plugin for the graphite reporter as well, see https://issues.apache.org/jira/browse/FLINK-4173


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #4299: [FLINK-7155] [metrics] Add Influxdb reporter

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4299#discussion_r126723260
  
    --- Diff: flink-metrics/flink-metrics-influxdb/pom.xml ---
    @@ -0,0 +1,97 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<!--
    +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.
    +-->
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    +
    +	<modelVersion>4.0.0</modelVersion>
    +
    +	<parent>
    +		<groupId>org.apache.flink</groupId>
    +		<artifactId>flink-metrics</artifactId>
    +		<version>1.4-SNAPSHOT</version>
    +		<relativePath>..</relativePath>
    +	</parent>
    +
    +	<artifactId>flink-metrics-influxdb</artifactId>
    +	<name>flink-metrics-influxdb</name>
    +
    +	<dependencies>
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-annotations</artifactId>
    +			<version>${project.version}</version>
    +			<scope>provided</scope>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-metrics-core</artifactId>
    +			<version>${project.version}</version>
    +			<scope>provided</scope>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>org.apache.flink</groupId>
    +			<artifactId>flink-metrics-dropwizard</artifactId>
    +			<version>${project.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>io.dropwizard.metrics</groupId>
    +			<artifactId>metrics-core</artifactId>
    +			<version>${metrics.version}</version>
    +		</dependency>
    +
    +		<dependency>
    +			<groupId>io.dropwizard.metrics</groupId>
    +			<artifactId>metrics-graphite</artifactId>
    --- End diff --
    
    why is this dependency needed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #4299: [FLINK-7155] [metrics] Add Influxdb reporter

Posted by yew1eb <gi...@git.apache.org>.
Github user yew1eb commented on the issue:

    https://github.com/apache/flink/pull/4299
  
    Hi @patricklucas ,
    Coding guidelines “No WIP pull requests.”  
    Maybe you should see: http://flink.apache.org/contribute-code.html
    
    BTW, If you do not have free time to finish it, I am willing to take over. :smile:
    
    Best,
    Hai Zhou



---